Try OpenEdge Now
skip to main content
Messaging and ESB
Programming for the OpenEdge Adapter for SonicMQ with the ABL - JMS API : Programming scenarios : Using ServerConnect and ClientConnect
 

Using ServerConnect and ClientConnect

OpenEdge clients can connect directly to a SonicMQ Broker by using the OpenEdge Adapter for SonicMQ for a messaging session. By connecting directly to the SonicMQ Broker, the OpenEdge client has better control over connection management, and there is no need to manage and configure a OpenEdge Adapter for SonicMQ server process. Additional benefits include the availability of client persistence and fault tolerance. For more information on client persistence, see Client persistence. For more information on fault tolerance, see Fault tolerance.
Caution: This method creates a larger run-time footprint for your OpenEdge client or AppServer/WebSpeed process.

Using SMQConnect on a client

In the following example, the application creates a session procedure by calling jmssession.p persistently specifying the -SMQConnect connection parameter.
DEFINE VARIABLE hSession AS HANDLE NO-UNDO.
RUN jms/jmssession.p PERSISTENT SET hSession ("-SMQConnect").
RUN setBrokerURL IN hSession ("MQBrokerHost:2506").
RUN beginSession IN hSession.
Note: Each messaging session creates a connection to the SonicMQ Broker. You can minimize the number of connections to the SonicMQ Broker by using the AppServer or WebSpeed process to execute a shared ABL–JMS session.
Prior to using ServerConnect in an AppServer or WebSpeed server, the AppServer or WebSpeed server must be enabled for SonicMQ ServerConnect enabled using Progress Explorer.
To enable the AppServer or WebSpeed server for ServerConnect:
1. Select the Messaging properties for the AppServer or WebSpeed server.
2. Select the SonicMQ ServerConnect enabled check box, as shown:
3. Select unique broker and server log filenames.
4. Select the logging level.
These settings start a SonicMQ ServerConnect process when the AppServer or WebSpeed server starts with specified logging options. After starting the AppServer or WebSpeed server, ensure the SonicMQ Broker is running.