8.2.20 Java Message Service (JMS)
The Java Message Service (JMS) Handler allows operations from a trail file to be formatted in messages, and then published to JMS providers like Oracle Weblogic Server, Websphere, and ActiveMQ.
This chapter describes how to use the JMS Handler.
Parent topic: Target
8.2.20.1 Overview
The Java Message Service is a Java API that allows applications to create, send, receive, and read messages. The JMS API defines a common set of interfaces and associated semantics that allow programs written in the Java programming language to communicate with other messaging implementations.
The JMS Handler captures the Oracle GoldenGate trail and sends those messages to the configured JMS providers.
Note:
The Java Message Service (JMS) Handler does not support DDL operations. In case of DDL operations, replicat/extract is expected to fail.Parent topic: Java Message Service (JMS)
8.2.20.2 Setting Up and Running the JMS Handler
The JMS Handler setup (JNDI configuration) depends on the JMS provider that you use.
The following sections provide instructions for configuring the JMS Handler components and running the handler.
Runtime Prerequisites
The JMS provider should be up and running with the required
ConnectionFactory
and QueueConnectionFactory
and TopicConnectionFactory
configured.
Security
Configure the SSL according to the JMS Provider used.
- Classpath Configuration
- Java Naming and Directory Interface Configuration
- Handler Configuration
- Sample Configuration Using Oracle WebLogic Server
Parent topic: Java Message Service (JMS)
8.2.20.2.1 Classpath Configuration
Oracle recommends that you store the JMS Handler properties file in the Oracle
GoldenGate dirprm
directory. The JMS Handler requires the JMS
Provider client JARs are in the classpath in order to execute. The location of the
providers client JARs is similar to:
gg.classpath= path_to_the_providers_client_jars
Parent topic: Setting Up and Running the JMS Handler
8.2.20.2.2 Java Naming and Directory Interface Configuration
You configure the Java Naming and Directory Interface (JNDI) properties to connect to an Initial Context to look up the connection factory and initial destination.
Table 8-29 JNDI Configuration Properties
Properties | Required/ Optional | Legal Values | Default | Explanation |
---|---|---|---|---|
|
Required |
Valid provider URL with port |
None |
Specifies the URL that the handler uses to look up objects on the server. For
example, |
|
Required |
Initial Context factory class name |
None |
Specifies which initial context factory to use when
creating a new initial context object. For Oracle WebLogic
Server, the value is
|
|
Required |
Valid user name |
None |
Specifies the user name to use. |
|
Required |
Valid password |
None |
Specifies the password for the user. |
Parent topic: Setting Up and Running the JMS Handler
8.2.20.2.3 Handler Configuration
You configure the JMS Handler operation using the properties file. These properties are located in the Java Adapter properties file (not in the Replicat properties file).
To enable the selection of the JMS Handler, you must first configure the
handler type by specifying gg.handler.name.type=jms
and the
other JMS properties as follows:
Table 8-30 JMS Handler Configuration Properties
Parent topic: Setting Up and Running the JMS Handler
8.2.20.2.4 Sample Configuration Using Oracle WebLogic Server
#JMS Handler Template
gg.handlerlist=jms
gg.handler.jms.type=jms
#TODO: Set the message formatter type
gg.handler.jms.format=
#TODO: Set the destination for resolving the queue/topic name.
gg.handler.jms.destination=
#Start of JMS handler properties when JNDI is used.
gg.handler.jms.useJndi=true
#TODO: Set the connectionFactory for resolving the queue/topic name.
gg.handler.jms.connectionFactory=
#TODO: Set the standard JNDI properties url, initial factory name, principal and credentials.
java.naming.provider.url=
java.naming.factory.initial=
java.naming.security.principal=
java.naming.security.credentials=
End of JMS handler properties when JNDI is used.
#Start of JMS handler properties when JNDI is not used.
#TODO: Comment the above properties related to useJndi is true.
#TODO: Uncomment the below properties to configure when useJndi is false.
#gg.handler.jms.useJndi=false
#TODO: Set connectionURL of MQ.
#gg.handler.jms.connectionUrl=
#TODO: Set the connection Factory Class of the MQ.
#gg.handler.jms.connectionFactoryClass=
#TODO: Set the path the jms client library wlthint3client.jar
gg.classpath=
jvm.bootoptions=-Xmx512m -Xms32m
Parent topic: Setting Up and Running the JMS Handler
8.2.20.3 JMS Dependencies
The Java EE Specification APIs have moved out of the JDK in Java 8. JMS is a part of this specification, and therefore this dependency is required.
Maven groupId: javax
Maven artifactId: javaee-api
Version: 8.0
You can download the jar from Maven Central Repository.
Parent topic: Java Message Service (JMS)