How properly close JCSMPSession

pierrett75 Member Posts: 2
edited August 2022 in General Discussions #1
Hello i need advice, we use sol-jcsmp version 10.15.0 Session is create with XmlMessageLIstener, XmlMessageConsumer and XMl MessageProducer. 
gproducer is create by JCSMPStreamingPublishCorrelatingEventHandler. 
wwhen i want to close session i call session.clouseSession() Problem is that after close i still can see running thred from 
and SyncEventDispatcherReacto.
How do i close all these thread properly ?

Thanks Petra


  • Ragnar
    Ragnar Member, Employee Posts: 53 Solace Employee

    Hi Petra,

    The ConsumerNotificationDispatcher and SyncEventDispatcherReactor thread are both created once per context and handle all sessions in the context.

    They will not exist when any Session is closed. However they will exit when the context is destroyed.

  • pierrett75
    pierrett75 Member Posts: 2

    Hi @Ragnar for response, so how i can destroy context ? we create JCSMPSession, with XMLmessageConsumer, we close the session.closeSession() but when i print threads a can see threads connected with solace:

    Context_1_ReactorThread RUNNABLE true$SubSelector.poll0(Native Method)$SubSelector.poll($SubSelector.access$400(



    Context_1_ConsumerDispatcher WAITING true

    sun.misc.Unsafe.park(Native Method)