1 Reply Latest reply on Mar 1, 2011 8:05 PM by 765276

    MessagingSession Instantiation and usage.

    765276
      Our project has a pattern of attaching a TransactionSynchronizationAdapter to JTA transactions and subsequently sending Coherence Messaging events based on the result of the transaction. This results in our thread pool instantiating MessagingSession objects concurrently and often (100 threads, processing 2 messages/thread a second, and sending out 2 messages a second per thread to a single coherence queue).

      The code to do this is fairly simple.

      public void afterCompletion(int status) {
                if (TransactionSynchronization.STATUS_COMMITTED == status){
                     MessagingSession messagingSession = DefaultMessagingSession.getInstance();
                messagingSession.publishMessage(outboundCompId, fixMessage); //These values are passed in the constructor of the object.
      }
      }

      However, we see some pretty wide times for publishing the message. Is there a best practice for reducing these latencies?

      Line 643: 10:45:04:884-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[28]
           Line 651: 10:45:04:910-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[9]
           Line 652: 10:45:04:910-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[7]
           Line 663: 10:45:04:963-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[12]
           Line 672: 10:45:05:003-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[22]
           Line 675: 10:45:05:013-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[19]
           Line 684: 10:45:05:068-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[5]
           Line 693: 10:45:05:129-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[30]
           Line 712: 10:45:05:317-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[52]
           Line 715: 10:45:05:329-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[117]
           Line 719: 10:45:05:340-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[35]
           Line 732: 10:45:05:546-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[41]
           Line 738: 10:45:05:569-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[42]
           Line 748: 10:45:05:624-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[11]
           Line 754: 10:45:05:672-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[4]
           Line 764: 10:45:05:740-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[15]
           Line 770: 10:45:05:816-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[17]
           Line 783: 10:45:05:876-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[24]
           Line 786: 10:45:05:888-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[2]
           Line 795: 10:45:06:048-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[17]
           Line 816: 10:45:06:234-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[58]
           Line 819: 10:45:06:236-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[57]
           Line 822: 10:45:06:236-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[55]
           Line 831: 10:45:06:275-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[9]
           Line 834: 10:45:06:284-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[12]
           Line 860: 10:45:06:626-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[44]
           Line 864: 10:45:06:662-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[120]
           Line 867: 10:45:06:662-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[108]
           Line 881: 10:45:06:738-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[4]
           Line 884: 10:45:06:738-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[21]
           Line 899: 10:45:06:805-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[10]
           Line 902: 10:45:06:810-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[5]
           Line 906: 10:45:06:823-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[4]
           Line 915: 10:45:06:912-DEBUG CoherenceOutboundMessageCallback.sendOutboundMessage - TT[2]