Author: clebert.suconic(a)jboss.com
Date: 2011-04-13 23:46:20 -0400 (Wed, 13 Apr 2011)
New Revision: 10506
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAddMetaDataMessageV2.java
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java
Log:
JBPAPP-6300 - small tweak on metadata (fixing a test (that was failing eventually under a
normal circunstance))
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2011-04-14
03:30:16 UTC (rev 10505)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/client/impl/ClientSessionImpl.java 2011-04-14
03:46:20 UTC (rev 10506)
@@ -1099,7 +1099,7 @@
public void addMetaData(String key, String data) throws HornetQException
{
metadata.put(key, data);
- channel.send(new SessionAddMetaDataMessageV2(key, data));
+ channel.sendBlocking(new SessionAddMetaDataMessageV2(key, data));
}
public ClientSessionFactoryInternal getSessionFactory()
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java 2011-04-14
03:30:16 UTC (rev 10505)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/ServerSessionPacketHandler.java 2011-04-14
03:46:20 UTC (rev 10506)
@@ -483,6 +483,10 @@
case PacketImpl.SESS_ADD_METADATA2:
{
SessionAddMetaDataMessageV2 message =
(SessionAddMetaDataMessageV2)packet;
+ if (message.isRequiresConfirmations())
+ {
+ response = new NullResponseMessage();
+ }
session.addMetaData(message.getKey(), message.getData());
break;
}
Modified:
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAddMetaDataMessageV2.java
===================================================================
---
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAddMetaDataMessageV2.java 2011-04-14
03:30:16 UTC (rev 10505)
+++
branches/Branch_2_2_EAP/src/main/org/hornetq/core/protocol/core/impl/wireformat/SessionAddMetaDataMessageV2.java 2011-04-14
03:46:20 UTC (rev 10506)
@@ -76,8 +76,6 @@
return requiresConfirmation;
}
-
-
public String getKey()
{
return key;
Modified:
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java
===================================================================
---
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java 2011-04-14
03:30:16 UTC (rev 10505)
+++
branches/Branch_2_2_EAP/tests/src/org/hornetq/tests/integration/jms/server/management/JMSServerControl2Test.java 2011-04-14
03:46:20 UTC (rev 10506)
@@ -556,23 +556,9 @@
JMSServerControl2Test.PING_PERIOD);
Connection connection = cf1.createConnection();
- long timeout = System.currentTimeMillis() + 5000;
-
- // Some of the send is asynchronous, so need to wait a few micro seconds
eventually
- while (System.currentTimeMillis() < timeout)
- {
- jsonStr = control.listConnectionsAsJSON();
- assertNotNull(jsonStr);
- infos = JMSConnectionInfo.from(jsonStr);
- if (infos.length == 1)
- {
- break;
- }
- else
- {
- Thread.sleep(500);
- }
- }
+ jsonStr = control.listConnectionsAsJSON();
+ assertNotNull(jsonStr);
+ infos = JMSConnectionInfo.from(jsonStr);
assertEquals(1, infos.length);
for (JMSConnectionInfo info : infos)
{
@@ -586,25 +572,9 @@
JMSServerControl2Test.PING_PERIOD);
Connection connection2 = cf2.createConnection();
- timeout = System.currentTimeMillis() + 5000;
-
- // Some of the send is asynchronous, so need to wait a few micro seconds
eventually
- while (System.currentTimeMillis() < timeout)
- {
- jsonStr = control.listConnectionsAsJSON();
- assertNotNull(jsonStr);
- infos = JMSConnectionInfo.from(jsonStr);
-
- if (infos.length == 2)
- {
- break;
- }
- else
- {
- Thread.sleep(500);
- }
- }
-
+ jsonStr = control.listConnectionsAsJSON();
+ assertNotNull(jsonStr);
+ infos = JMSConnectionInfo.from(jsonStr);
assertEquals(2, infos.length);
for (JMSConnectionInfo info : infos)
{
Show replies by date