@@ -64,7 +64,7 @@ public InterconnectResponseContext(@Nonnull TextMessage message, boolean secure,
6464 InterconnectContextBuilder receivedContextBuilder = new InterconnectContextBuilder () //
6565 .withTarget (JmsTarget .RECEPTION_CONTEXT ).withSecure (secure ) //
6666 .withRequestICO (receivedIco ) //
67- .withCorrelationId (this .extractCorreationId ()) //
67+ .withCorrelationId (this .extractCorrelationId ()) //
6868 .withReplyToDestination (this .getReplyToDestination ());
6969 this .receivedContext = receivedContextBuilder .build ();
7070 }
@@ -77,7 +77,7 @@ private Destination getReplyToDestination() throws InfrastructureException {
7777 }
7878 }
7979
80- private String extractCorreationId () throws InfrastructureException {
80+ private String extractCorrelationId () throws InfrastructureException {
8181 try {
8282 return this .getReceivedMessage ().getJMSCorrelationID ();
8383 } catch (JMSException e ) {
@@ -88,8 +88,10 @@ private String extractCorreationId() throws InfrastructureException {
8888 private InterconnectObject extractIco () throws InfrastructureException {
8989 try {
9090 return InterconnectMapper .fromJson (this .getReceivedMessage ().getText (), InterconnectObject .class );
91- } catch (final IOException | JMSException e ) {
92- throw new InfrastructureException ("Failed to create ico from message" );
91+ } catch (final IOException e ) {
92+ throw new InfrastructureException ("Failed to create ico from message. Json parsing failed." , e );
93+ } catch (final JMSException e ) {
94+ throw new InfrastructureException ("Failed to read message content from received message!" , e );
9395 }
9496 }
9597
@@ -166,20 +168,16 @@ public HandlingDuration handlingDuration() {
166168 * @return a default timeout message for logging or exceptions
167169 */
168170 public String timeoutMessage () {
169- return "Response skipped because runtime " + this .getLastHandlingRuntime () + " ms was greater than timeout " +
170- this .getCreateResponseMethod ().getTimeoutInMs () + " ms for " +
171- this .getCreateResponseMethod ().getMethod ().getName () + "(" +
172- this .getReceivedContext ().getIcoClass ().getSimpleName () + ")" + " with " +
173- de .taimos .dvalin .interconnect .model .InterconnectContext .getContext ();
171+ return "Response skipped because runtime " + this .getLastHandlingRuntime () + " ms was greater than timeout " + this .getCreateResponseMethod ()
172+ .getTimeoutInMs () + " ms for " + this .getCreateResponseMethod ().getMethod ().getName () + "(" + this .getReceivedContext ().getIcoClass ()
173+ .getSimpleName () + ")" + " with " + de .taimos .dvalin .interconnect .model .InterconnectContext .getContext ();
174174 }
175175
176176 /**
177177 * @return a default slow response message for logging or exceptions
178178 */
179179 public String slowResponseMessage () {
180- return "Slow response because runtime " + this .getLastHandlingRuntime () + " ms for " +
181- this .getCreateResponseMethod ().getMethod ().getName () + "(" +
182- this .getReceivedContext ().getIcoClass ().getSimpleName () + ")" + " with " +
183- de .taimos .dvalin .interconnect .model .InterconnectContext .getContext ();
180+ return "Slow response because runtime " + this .getLastHandlingRuntime () + " ms for " + this .getCreateResponseMethod ().getMethod ()
181+ .getName () + "(" + this .getReceivedContext ().getIcoClass ().getSimpleName () + ")" + " with " + de .taimos .dvalin .interconnect .model .InterconnectContext .getContext ();
184182 }
185183}
0 commit comments