Messages sent by Spring JmsTemplate not being received by normal JCSMP subscriber

Attempt No2 for a reply… pls find my answers inline.

Yes that is correct.

  • Your other receiver, not in the post, is just the TopicSubscriber.java class as is with only a change to the TOPIC_NAME variable?
    Yap, code is below which is tried and tested as its part of a gui tool we use for testing on daily basis.
private void subscribeSolaceTopic(String pTopic) {


    try {
        solaceConsumer = solaceSession.getMessageConsumer(new XMLMessageListener() {

            public void onReceive(BytesXMLMessage msg) {
                LOG.info("onReceive->Message Dump: {}", msg.dump());
                
                });
        
                
            }

            public void onException(JCSMPException e) {
                LOG.error("Consumer received exception:  {}", e);
            }
        });

        Topic topic = JCSMPFactory.onlyInstance().createTopic(pTopic);

        solaceTopic = topic;

        solaceSession.addSubscription(topic);

        LOG.info("Connected. Awaiting message...");
        solaceConsumer.start();

    } catch (JCSMPException e1) {
        LOG.error(EXCEPTION_OCCURRED , e1);
        
    }

}
  • Can you share the rest of your class above where you autowire the jmstemplate?

The autowire is done on a field and its up there near the top of my first post. If you want I can try attaching the entire project ?

Thanks,
Ali