Hi all, 

Apologies for potential double-posts—Nabble doesn't seem to be working right, 
so I decided to try the ML directly.

I'm using ActiveMQ 5.4.2, with queues and non-persistent messaging. The 
operating system is SLES 10 (Linux 2.6.18), JVM 1.6, running a 64-bit server 
VM. I'm not using any application server on the producer end, just creating a 
connection factory manually.

A Java producer is being used to send messages to STOMP-based consumers 
(primarily Flex/Flash, but maybe also JavaScript in the future). The STOMP 
clients also produce some messages, and those arrive fine, and the Java 
consumer is able to pick them up and react to them (including sending a message 
back—this happens on a different queue than the problem queue though). However, 
when the Java producer begins to send messages, no messages arrive in the 
problem queue. The pending count never increases, and the STOMP consumers never 
get any messages. Producer flow control is turned off, and as mentioned 
earlier, messages are not persistent. They're also set to expire after 2.5 
seconds.

My code looks like this: 
Message m;

try {
    m = sess.createTextMessage(inputMessage);
} catch (JMSException e) {
    l.error("Error creating ActiveMQ message. Error message: ", e);
    return;
}

try {
    producer.send(m);
    l.info ("Message sent to broker.");
} catch (JMSException e) {
    l.error("Error sending ActiveMQ message. Error message: ", e);
    return;
}
l is a log4j Logger, and sess is a session obtained from an 
ActiveMQConnectionFactory. The factory is set up as such: 
ActiveMQConnectionFactory factory = new ActiveMQConnectionFactory(brokerUrl), 
and async dispatch/sending is disabled (though having it enabled didn't help 
either). 

A different queue (with a different producer) works just fine—the JMS producer 
is able to send a message to the queue, and it's received on the STOMP end. Is 
there any reason why my JMS producer wouldn't work on one queue, and would work 
for another, when STOMP works fine for both producing and consuming? I was 
getting some dead letter queue errors earlier, but resolved them by telling the 
dead letter queue to not handle messages that expire. If my messages are going 
to the dead letter queue, how can I establish why, so that I can fix the issue?

Cheers,
Bojan Rajkovic

Reply via email to