8.1.7 Java Message Service (JMS)
This article explains using the Oracle GoldenGate for Distributed Applications and Analytics (GG for DAA) to capture Java Message Service (JMS) messages to be written to an Oracle GoldenGate trail.
- Prerequisites
- Configuring Message Capture
This chapter explains how to configure the VAM Extract to capture JMS messages.
Parent topic: Source
8.1.7.1 Prerequisites
8.1.7.1.1 Set up Credential Store Entry to Detect Source Type
JMS Capture
Similar to Kafka, for the sake of detecting the source type, user can create a credential store entry with the prefix:jms://
.
Note:
You can set up Credential Store Entry in Administration Service/ DB Connections.alter credentialstore add user jms:// password <anypassword> alias jms
SOURCEDB
parameter with USERIDALIAS
option, then
the source type will be assumed to be JMS, and a warning message will be logged to
indicate this.
Parent topic: Prerequisites
8.1.7.2 Configuring Message Capture
Parent topic: Java Message Service (JMS)
8.1.7.2.1 Configuring the VAM Extract
JMS Capture only works with the Oracle GoldenGate Extract process. To run the Java message capture application you need the following:
-
Oracle GoldenGate for Java Adapter
-
Extract process
-
Extract parameter file configured for message capture
-
Description of the incoming data format, such as a source definitions file.
-
Java 8 installed on the host machine
Parent topic: Configuring Message Capture
8.1.7.2.1.1 Adding the Extract
To add the message capture VAM to the Oracle GoldenGate installation, add an Extract and the trail that it will create using GGSCI commands:
ADD EXTRACT jmsvam, VAM ADD EXTTRAIL dirdat/id, EXTRACT jmsvam, MEGABYTES 100
The process name (jmsvam
) can be replaced with any process name that is no more than 8 characters. The trail identifier (id
) can be any two characters.
Note:
Commands to position the Extract, such as BEGIN
or EXTRBA
, are not supported for message capture. The Extract will always resume by reading messages from the end of the message queue.
Parent topic: Configuring the VAM Extract
8.1.7.2.1.2 Configuring the Extract Parameters
The Extract parameter file contains the parameters needed to define and invoke the VAM. Sample Extract parameters for communicating with the VAM are shown in the table.
Parent topic: Configuring the VAM Extract
8.1.7.2.1.3 Configuring Message Capture
Message capture is configured by the properties in the VAM properties file (Adapter Properties file. This file is identified by the PARAMS
option of the Extract VAM
parameter and used to determine logging characteristics, parser mappings and JMS connection settings.
Parent topic: Configuring the VAM Extract
8.1.7.2.2 Connecting and Retrieving the Messages
To process JMS messages you must configure the connection to the JMS interface, retrieve and parse the messages in a transaction, write each message to a trail, commit the transaction, and remove its messages from the queue.
Parent topic: Configuring Message Capture
8.1.7.2.2.1 Connecting to JMS
Connectivity to JMS is through a generic JMS interface. Properties can be set to configure the following characteristics of the connection:
-
Java classpath for the JMS client
-
Name of the JMS queue or topic source destination
-
Java Naming and Directory Interface (JNDI) connection properties
-
Connection properties for Initial Context
-
Connection factory name
-
Destination name
-
-
Security information
-
JNDI authentication credentials
-
JMS user name and password
-
The Extract process that is configured to work with the VAM (such as the jmsvam
in the example) will connect to the message system. when it starts up.
Note:
The Extract may be included in the Manger's AUTORESTART
list so it will automatically be restarted if there are connection problems during processing.
Currently the Oracle GoldenGate for Java message capture adapter supports only JMS text messages.
Parent topic: Connecting and Retrieving the Messages
8.1.7.2.2.2 Retrieving Messages
The connection processing performs the following steps when asked for the next message:
-
Start a local JMS transaction if one is not already started.
-
Read a message from the message queue.
-
If the read fails because no message exists, return an end-of-file message.
-
Otherwise return the contents of the message.
Parent topic: Connecting and Retrieving the Messages
8.1.7.2.2.3 Completing the Transaction
Once all of the messages that make up a transaction have been successfully retrieved, parsed, and written to the Oracle GoldenGate trail, the local JMS transaction is committed and the messages removed from the queue or topic. If there is an error then the local transaction is rolled back leaving the messages in the JMS queue.
Parent topic: Connecting and Retrieving the Messages