Class JcsmpSessionService
java.lang.Object
org.apache.beam.sdk.io.solace.broker.SessionService
org.apache.beam.sdk.io.solace.broker.JcsmpSessionService
- All Implemented Interfaces:
Serializable
A class that manages a connection to a Solace broker using basic authentication.
This class provides a way to connect to a Solace broker and receive messages from a queue.
- See Also:
-
Field Summary
Fields inherited from class org.apache.beam.sdk.io.solace.broker.SessionService
DEFAULT_VPN_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Gracefully closes the connection to the service.void
connect()
Establishes a connection to the service.static JcsmpSessionService
create
(JCSMPProperties jcsmpProperties, Queue queue) getInitializedProducer
(SolaceIO.SubmissionMode submissionMode) Returns a MessageProducer object for publishing messages to Solace.Returns theQueue<Solace.PublishResult>
instance associated with this session, with the asynchronously received callbacks from Solace for message publications.Returns a MessageReceiver object for receiving messages from Solace.Override this method and provide your specific properties, including all those related to authentication, and possibly others too.Methods inherited from class org.apache.beam.sdk.io.solace.broker.SessionService
equals, hashCode, initializeWriteSessionProperties
-
Constructor Details
-
JcsmpSessionService
public JcsmpSessionService()
-
-
Method Details
-
create
-
getSessionProperties
Description copied from class:SessionService
Override this method and provide your specific properties, including all those related to authentication, and possibly others too.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:
- Specified by:
getSessionProperties
in classSessionService
-
connect
public void connect()Description copied from class:SessionService
Establishes a connection to the service. This could involve providing connection details like host, port, VPN name, username, and password.- Specified by:
connect
in classSessionService
-
close
public void close()Description copied from class:SessionService
Gracefully closes the connection to the service.- Specified by:
close
in classSessionService
-
getReceiver
Description copied from class:SessionService
Returns a MessageReceiver object for receiving messages from Solace. If it is the first time this method is used, the receiver is created from the session instance, otherwise it returns the receiver created initially.- Specified by:
getReceiver
in classSessionService
-
getInitializedProducer
Description copied from class:SessionService
Returns a MessageProducer object for publishing messages to Solace. If it is the first time this method is used, the producer is created from the session instance, otherwise it returns the producer created initially.- Specified by:
getInitializedProducer
in classSessionService
-
getPublishedResultsQueue
Description copied from class:SessionService
Returns theQueue<Solace.PublishResult>
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.- Specified by:
getPublishedResultsQueue
in classSessionService
-