How to capture com.solacesystems.jcsmp.JCSMPErrorResponseException: 503

JaePark Member Posts: 2

I am using com.solacesystems.jms.SolConnection to create a connection to my cloud example.
When I disable the mssage VPN, I get the following error in the wrapper log:
TcpClientChannel 09Jun2020 20:43:36 Connection attempt failed to host '' ReconnectException ((Client name: xxxxxx Local addr: xxxxxx Remote addr: xxxxxxx) - ) com.solacesystems.jcsmp.JCSMPErrorResponseException: 503: Message VPN Unavailable [Subcode:9]

How can I capture this within my java class? I've implemented SolConnectionEventListener, but that only gets me "CAUSE: com.solacesystems.jcsmp.JCSMPTransportException: Error receiving data from underlying connection."


  • Aaron
    Aaron Member, Administrator, Moderator, Employee Posts: 541 admin

    Ok... so you're shutting down the VPN to simulate a network outage? That's cool. The API will automatically attempt to reconnect for the amount of times specified in your JCSMPChannelProperties. By default, only once all reconnect attempts have failed will a (transport) exception be thrown up to the application to signal there was a failure.

    But if the application wants to be notified of disconnect/reconnect events (e.g. to set a GUI element or something), then you gotta implement the JCSMPReconnectEventHandler when you create the Consumer object:, com.solacesystems.jcsmp.XMLMessageListener)

    Hope that helps!

  • JaePark
    JaePark Member Posts: 2

    I will have to test using a lower retry amount.
    I am using jms 1.1. Is there a similar ReconnectEventHanlder for it? I am creating my consumer with javax.session.createConsumer(topic)
    Thank you.

  • Aaron
    Aaron Member, Administrator, Moderator, Employee Posts: 541 admin

    Ok... first off... I misread/misunderstood your original question... you were looking to find how to capture the more detailed log/reason information in your exception, correct? Not just have your application be aware of connection issues? If the former, I don't think you can get the exact reason in the exception.

    Anyhow... if it was the latter... in JMS, the JMS specification doesn't explicitly provide any mechanism to "listen" to disconnect/reconnect events. Only once your connection retry attempts are exhausted does the API throw a JMSException up to the applicaiton. Usually.

    But in Solace, there is a way for a JMS app to hook up to these notification events... check out:

    It is possible to register an SolConnectionEventListener to receive callbacks whenever the connection state transitions. Here is an sample snippet:

    SolConnectionEventSource eventSource = (SolConnectionEventSource) jmsConnection;
    eventSource.setConnectionEventListener(new SolConnectionEventListener() {
    public void onEvent(SolConnectionEvent event) {

    Javadocs can be found at:
    You will need to search for SolConnectionEventListener.

  • marc
    marc Member, Administrator, Moderator, Employee Posts: 923 admin

    Awesome, thanks @Aaron! I learned something today :)