[hornetq-commits] JBoss hornetq SVN: r10734 - branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed May 25 16:14:23 EDT 2011


Author: jicken
Date: 2011-05-25 16:14:23 -0400 (Wed, 25 May 2011)
New Revision: 10734

Modified:
   branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools/ManageDataTool.java
Log:
ClientRequestor expects a ClientSession with automatic commits of sends and acknowledgements

Modified: branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools/ManageDataTool.java
===================================================================
--- branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools/ManageDataTool.java	2011-05-25 19:32:16 UTC (rev 10733)
+++ branches/Branch_2_2_EAP_export_tool/src/main/org/hornetq/core/persistence/tools/ManageDataTool.java	2011-05-25 20:14:23 UTC (rev 10734)
@@ -504,6 +504,7 @@
          final ClientSession coreSession = sf.createSession();
 
          // message notification callback
+         final ClientSessionFactory finalSf = sf;
          final MessagesExportType.Listener listener = new MessagesExportType.Listener()
          {
             public void handleMessage(MessageType message) throws Exception {
@@ -534,11 +535,12 @@
             }
 
             private long getNewQueueId(QueueType queue) throws Exception {
-               ClientRequestor requestor = new ClientRequestor(coreSession, ConfigurationImpl.DEFAULT_MANAGEMENT_ADDRESS);
-               ClientMessage m = coreSession.createMessage(false);
+               final ClientSession requestorSession = finalSf.createSession(true, true);
+               ClientRequestor requestor = new ClientRequestor(requestorSession, ConfigurationImpl.DEFAULT_MANAGEMENT_ADDRESS);
+               ClientMessage m = requestorSession.createMessage(false);
                ManagementHelper.putAttribute(m, ResourceNames.CORE_QUEUE + queue.getName(), "ID");
 
-               final TextMessage reply = (TextMessage) requestor.request(m);
+               final TextMessage reply = (TextMessage) requestor.request(m, 5000);
                return Long.parseLong(reply.getText());
             }
 



More information about the hornetq-commits mailing list