activemq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Datacom - Marcelo <marc...@datacom-telematica.com.br>
Subject Byte selector does not work
Date Wed, 17 May 2006 18:24:16 GMT
Hi, we'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)

-- 
MARCELO Ribeiro


DATACOM
Av. Fran├ža, 735 - Porto Alegre, RS - 90230-220
DDR: 51 3358 0141
Fax: 51 3358 0101
site:   www.datacom-telematica.com.br
e-mail: marcelo@datacom-telematica.com.br


Mime
View raw message