Selectors on byte properties now working.
-----------------------------------------
Key: AMQ-715
URL: https://issues.apache.org/activemq/browse/AMQ-715
Project: ActiveMQ
Type: Bug
Versions: 4.0, 4.0 M4, 4.0 RC2, 4.0 RC3
Reporter: Hiram Chirino
Assigned to: Hiram Chirino
Fix For: 4.1
Reported on mailing list by Marcelo Ribeiro:
W're using active-mq 4.0-rc2 and realize that any message sent are not
received if we use a selector with a byte param. Here is the two
programs used to show this behavior. If we change this param from byte
to int it works. Is this a known bug ?
Some parts are not shown to make this sample smaller.
(MESSAGE SENDER)
......................
public static void main(String[] args) throws Exception {
TopicPublisher publisher =
getSession().createPublisher(MessageClient.topic);
System.out.println("Started...");
Message msg = getSession().createMessage();
msg.setByteProperty("dummy", (byte) 33);
publisher.publish(msg);
System.out.println("Message sent.");
try {Thread.sleep(10000);} catch (Exception exc) {}
publisher.close();
session.close();
conn.close();
System.out.println("Finished.");
}
(end)
(MESSAGE RECEIVER)
......................
public static void main(String[] args) throws Exception {
JmsReceiverTest listen = new JmsReceiverTest();
System.out.println("Started...");
TopicSubscriber subscriber =
getSession().createSubscriber(MessageClient.topic, "dummy = 33", false);
subscriber.setMessageListener(listen);
synchronized (listen) {
listen.wait(30000);
}
subscriber.close();
session.close();
conn.close();
System.out.println("Finished.");
}
public void onMessage(Message msg) {
System.out.println("Message received.");
try {
for (Enumeration e = msg.getPropertyNames();
e.hasMoreElements();) {
String name = (String) e.nextElement();
System.out.println("Property name: " + name + ", value =
" + msg.getObjectProperty(name));
}
} catch (Exception exc) {
exc.printStackTrace();
}
this.notify();
}
(end)
Thanks in advance,
Marcelo Ribeiro
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
https://issues.apache.org/activemq/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira