🎄 Happy Holidays! 🥳

Most of Solace is closed December 24–January 1 so our employees can spend time with their families. We will re-open Thursday, January 2, 2024. Please expect slower response times during this period and open a support ticket for anything needing immediate assistance.

Happy Holidays!

Please note: most of Solace is closed December 25–January 2, and will re-open Tuesday, January 3, 2023.

com.solacesystems.jcsmp.ClosedFacilityException: Tried to perform operation on a closed XML message

Suneel
Suneel Member Posts: 1
edited August 2021 in General Discussions #1

Hi,
Can someone advise on below error ?
com.solacesystems.jcsmp.ClosedFacilityException: Tried to perform operation on a closed XML message producer

one of the publisher flow in our app sends only few messages in a day. Would keepAlive config solve this problem ? I already have reconnect config in place.

Answers

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

    Hey @Suneel,

    I think you're correct to check the keepalive configuration. The message producer shouldn't just disconnect due to infrequent use. If you can re-produce in a dev/test environment I would also recommend enabling debug logging to get more info about what is going on.

    Hope that helps

  • TomF
    TomF Member, Employee Posts: 412 Solace Employee

    Hi @Suneel, could you also check your session and flow event handlers? It's possible you've had a session or flow event indicating that the session or flow had been closed, and the error notification will tell you why. You may already have this configured, just looking to check...

    For instance, if you're creating your publisher flow with:

    session.getMessageProducer(...)

    You'll need to provide an error handler. From the SolaceSample QueueProducer.java:

    final XMLMessageProducer prod = session.getMessageProducer(
    new JCSMPStreamingPublishEventHandler() {
    @Override
    public void responseReceived(String messageID) {
    System.out.printf("Producer received response for msg ID #%s%n",messageID);
    }
    @Override
    public void handleError(String messageID, JCSMPException e, long timestamp) {
    System.out.printf("Producer received error for msg ID %s @ %s - %s%n",
    messageID,timestamp,e);
    }
    });

    What's nice about this sample is it will give you more details on why you got the ClosedFacilityException.