How to configure the @JmsListener and receive Solace Topic messages ?

bxb Member Posts: 5

Hi @marc , I followed your tutorial in this thread, how to listen to Solace Topic via JMS. I tried to configure it in my program as well, but I got an error of : unknown endpoint (503: Unknown Queue). 
I just started learning Solace, can you help me find the issue ? 
Think you~
This is my JMS configurations:
public ConnectionFactory connectionFactory() throws Exception {
    Properties env = new Properties();
    env.put(InitialContext.INITIAL_CONTEXT_FACTORY, "com.solacesystems.jndi.SolJNDIInitialContextFactory");
    env.put(InitialContext.PROVIDER_URL, solaceProperties.getBrokerUrl());
    env.put(SupportedProperty.SOLACE_JMS_VPN, solaceProperties.getVpn());
    env.put(InitialContext.SECURITY_PRINCIPAL, solaceProperties.getUsername());
    env.put(InitialContext.SECURITY_CREDENTIALS, solaceProperties.getPassword());
    SolConnectionFactory solConnectionFactory = SolJmsUtility.createConnectionFactory(env);
    return solConnectionFactory;

@JmsListener(destination = "TestTopic01")
void receiveMsgFromTopic(Message msg) {"received Solace Topic message>>>>>>>>>>");
    StringBuffer msgAsStr = new StringBuffer("============= Received \nHeaders:");
    MessageHeaders hdrs = msg.getHeaders();
    msgAsStr.append("\nUUID: " + hdrs.getId());
    msgAsStr.append("\nTimestamp: " + hdrs.getTimestamp());
    Iterator<String> keyIter = hdrs.keySet().iterator();
    while (keyIter.hasNext()) {
        String key =;
        msgAsStr.append("\n" + key + ": " + hdrs.get(key));
    msgAsStr.append("\nPayload: " + msg.getPayload());;

I have configured "" in my file.

But my program reports an error : Unknown Queue


  • bxb
    bxb Member Posts: 5

    @marc I'm sorry, I think I have solved this issue by configuring the DefaultJmsListenerContainerFactory