Hi,

Could you attach your client code, so we could test it and see? (producer and consumer) :)


Markus Joschko wrote:
Hi,
I think I made a stupid mistake but I can't find it. I simply try to send
and receive a message from a topic. The problem is that if I try to send a
message from the code, it is never delivered to the clients (which are using
MessageAvailableListeners and operate on one connection). However I can see
in the JMX console, that there are two subscriptions on the topic "test".
Furthermore I see the attribute enqueuecount on the test topic increasing
when I send a message from the java code. On the Operations tab of the test
topic I can press the browseAsTable button I can see a number of JMS
messages which match the one I sent (at least the priority and the
timestamp). However fields like JMSType and properties are empty???

Doing a further test in the JMX console by sending a textmessage from it
triggers the clients. The messages are received correctly.
Hm, I have no clue what's going wrong. The code that sends the message:

            Destination destination = session.createTopic(channel);
            TextMessage message = this.session.createTextMessage(text);
            MessageProducer producer = this.session.createProducer(null);
producer.setDeliveryMode(DeliveryMode.NON_PERSISTENT);
            producer.setDisableMessageID(false);
            producer.setPriority(1);
            producer.send(destination, message);
            producer.close();

I wonder if it is correct to create the topic again to send a message.
However if I store the destination and reuse it, it doesn't work either.

Another thing that I can see in the JMX console and that makes me wonder is
that there are multiple topics:

test ActiveMQ.Advisory.Consumer.Topic.test

as soon as I send a message via the JMX console a further topic is created

ActiveMQ.Advisory.Producer.Topic.test

This does not happen if I try to send the message from the java code. Seems
that I don't understand how to correctly create a topic for a
messageproducer .....

Thanks for reading, Markus


Reply via email to