public abstract class JcsmpSessionService extends SessionService
This class provides a way to connect to a Solace broker and receive messages from a queue.
DEFAULT_VPN_NAME
Constructor and Description |
---|
JcsmpSessionService() |
Modifier and Type | Method and Description |
---|---|
void |
close()
Gracefully closes the connection to the service.
|
void |
connect()
Establishes a connection to the service.
|
static JcsmpSessionService |
create(JCSMPProperties jcsmpProperties,
Queue queue) |
MessageProducer |
getInitializedProducer(SolaceIO.SubmissionMode submissionMode)
Returns a MessageProducer object for publishing messages to Solace.
|
java.util.Queue<Solace.PublishResult> |
getPublishedResultsQueue()
Returns the
Queue instance associated with this session, with the
asynchronously received callbacks from Solace for message publications. |
MessageReceiver |
getReceiver()
Returns a MessageReceiver object for receiving messages from Solace.
|
JCSMPProperties |
getSessionProperties()
Override this method and provide your specific properties, including all those related to
authentication, and possibly others too.
|
equals, hashCode, initializeWriteSessionProperties
public static JcsmpSessionService create(JCSMPProperties jcsmpProperties, @Nullable Queue queue)
public JCSMPProperties getSessionProperties()
SessionService
The method will be used whenever the session needs to be created or refreshed. If you are setting credentials with expiration, just make sure that the latest available credentials (e.g. renewed token) are set when the method is called.
For a list of all the properties that can be set, please check the following link:
getSessionProperties
in class SessionService
public void connect()
SessionService
connect
in class SessionService
public void close()
SessionService
close
in class SessionService
public MessageReceiver getReceiver()
SessionService
getReceiver
in class SessionService
public MessageProducer getInitializedProducer(SolaceIO.SubmissionMode submissionMode)
SessionService
getInitializedProducer
in class SessionService
public java.util.Queue<Solace.PublishResult> getPublishedResultsQueue()
SessionService
Queue
instance associated with this session, with the
asynchronously received callbacks from Solace for message publications. The queue
implementation has to be thread-safe for production use-cases.getPublishedResultsQueue
in class SessionService