This commit is contained in:
@@ -85,7 +85,7 @@ public class HttpMessageProcessor implements MessageProcessor {
|
|||||||
servlet.execute(request, response);
|
servlet.execute(request, response);
|
||||||
} catch (Exception ex) {
|
} catch (Exception ex) {
|
||||||
if (message.getResptopic() != null && !message.getResptopic().isEmpty()) {
|
if (message.getResptopic() != null && !message.getResptopic().isEmpty()) {
|
||||||
HttpMessageResponse.finishHttpResult(message, callback, producer, message.getResptopic(), new HttpResult().status(500));
|
HttpMessageResponse.finishHttpResult(finest, message, callback, producer, message.getResptopic(), new HttpResult().status(500));
|
||||||
}
|
}
|
||||||
logger.log(Level.SEVERE, HttpMessageProcessor.class.getSimpleName() + " process error, message=" + message, ex);
|
logger.log(Level.SEVERE, HttpMessageProcessor.class.getSimpleName() + " process error, message=" + message, ex);
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
@@ -49,13 +49,14 @@ public class HttpMessageResponse extends HttpResponse {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void finishHttpResult(HttpResult result) {
|
public void finishHttpResult(HttpResult result) {
|
||||||
finishHttpResult(this.message, this.callback, this.producer, message.getResptopic(), result);
|
finishHttpResult(this.finest, this.message, this.callback, this.producer, message.getResptopic(), result);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void finishHttpResult(MessageRecord msg, Runnable callback, MessageProducer producer, String resptopic, HttpResult result) {
|
public static void finishHttpResult(boolean finest, MessageRecord msg, Runnable callback, MessageProducer producer, String resptopic, HttpResult result) {
|
||||||
if (callback != null) callback.run();
|
if (callback != null) callback.run();
|
||||||
if (resptopic == null || resptopic.isEmpty()) return;
|
if (resptopic == null || resptopic.isEmpty()) return;
|
||||||
ConvertType format = result.convert() == null ? null : result.convert().getFactory().getConvertType();
|
ConvertType format = result.convert() == null ? null : result.convert().getFactory().getConvertType();
|
||||||
|
if (finest) producer.logger.log(Level.FINEST, "HttpMessageProcessor.process seqid=" + msg.getSeqid() + ", result: " + result);
|
||||||
byte[] content = HttpResultCoder.getInstance().encode(result);
|
byte[] content = HttpResultCoder.getInstance().encode(result);
|
||||||
producer.apply(new MessageRecord(msg.getSeqid(), format, resptopic, null, content));
|
producer.apply(new MessageRecord(msg.getSeqid(), format, resptopic, null, content));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user