20 Utilities for Enqueuing and Dequeuing

Oracle B2B provides utilities to test and verify your installation and configuration before connecting to the host (back-end) applications. Use the utilities to learn how to send and receive business messages to and from Oracle B2B through the default AQ queue interface or the JMS queue interface. Other AQ internal delivery channels can be handled in the same way. See the B2B samples for examples of how to implement these utilities.

This chapter contains the following topics:

20.1 AQ Enqueue and Dequeue Utilities

You can enqueue to and dequeue from an AQ queue using Java. IPEnqueue and IPDequeue must be executed in the Oracle B2B environment.

20.1.1 AQ Enqueue

Table 20-1 lists the Java AQ enqueue utility properties.

Table 20-1 IPEnqueue Properties

Name Description

queue

The outbound AQ queue name. If unspecified, the Java enqueue utility uses the default outbound queue IP_OUT_QUEUE.

replyToMsgID

The message ID to which the sending message is replying, typically used for the response message type.

from

Trading partner that sends the message

to

Trading partner that receives the message

doctypeName

Document type name for the message

doctypeRevision

Document protocol revision for the message

payload

Payload file name

attachment

Attachment file name

url

The database URL format is jdbc:oracle:thin:@host:port:sid

user

The database user

password

The database password

eventName

Action name

msgID

Message ID (optional). B2B generates its own message ID if it is not provided as part of an enqueue.

msgType

Provide an optional message type:

  • Request = 1 (default)

  • Response = 2

  • Functional Ack = 9


Example: ipenqueue.properties

queue           =
url             = jdbc:oracle:thin:@host:1521:sid
user             = user1
password         = password
replyToMsgID    =
from            = "Acme"
to              = "GlobalChips"
doctypeName     = 850
doctypeRevision = 4010
payload         = Acme_850.xml
attachment      =

Note:

In Windows ja_JP locale instances, the VARCHAR/String values are not enqueued correctly to the queue. The INT and CLOB values are enqueued correctly. This causes some fields, such as the from and to fields, to be null when the IPEnqueue utility is used to enqueue a file. As a workaround, in ja_JP locales, orai18n.jar should be added to the classpath while using oracle.tip.b2b.data.IPEnqueue.

20.1.2 AQ Dequeue

To dequeue messages, use the IPDequeue utility.

Table 20-2 lists the Java AQ dequeue utility properties.

Table 20-2 IPDequeue Properties

Name Description

queue

The inbound AQ queue name. If unspecified, the Java dequeue utility uses the default inbound queue IP_IN_QUEUE.

count

The number of messages to dequeue. If unspecified, only one message is dequeued.

output

Output file name

url

The database URL format is jdbc:oracle:thin:@host:port:sid

user

The database user

password

The database password


Example: ipdequeue.properties:

queue            =
count            = 1
output           = t1.trc
url              = jdbc:oracle:thin:@host:1521:sid
user             = user1
password         = password

20.2 JMS Enqueue and Dequeue Utilities

You can enqueue to and dequeue from a JMS destination (queue or topic) using utilities.

20.2.1 JMS Enqueue

Use the JMS enqueue utility to send a message to a JMS destination (queue or topic). This utility expects a property file to be provided as a command line argument where it reads the details to be sent.

Table 20-3 lists the properties that can be configured in the file.

Table 20-3 JMS Enqueue Properties

Name Description

destination

JNDI name of queue or topic to send message to

cf

JNDI name of connection factory to use

factory

Factory provider class

isTopic

Indicator for topic (optional)

url

The database URL format is jdbc:oracle:thin:@host:port:sid

user

The database user

password

The database password

from

From party

to

To party

eventName

Action name

doctypeName

Document type name

doctypeRevision

Document type revision

payload

Payload file path

attachment

Attachment file path

msgID

Message ID (optional). B2B generates its own message ID if it is not provided as part of an enqueue.

replyToMsgID

Reply to message (optional)

msgType

Message type; the default is Request (optional).


Example 20-1 shows the sample jms_enqueue.properties file.

Example 20-1 Sample jms_enqueue.properties File

####### Destination Details        #######
destination = jms/b2b/B2B_IN_QUEUE
cf = jms/b2b/B2BQueueConnectionFactory

####### Server and Factory Details #######
factory=weblogic.jndi.WLInitialContextFactory
url=t3://stacz36:8001/
#user=<uncomment and provide you username>
#password=<uncomment and proivde you password if required>

####### Payload Details #######
from=Acme
to=GlobalChips
#eventName=SampleEvent
doctypeName=Custom
doctypeRevision=1.0
payload=/scratch/work/GlobalChips_1234.dat

See the sample documentation for how to run these utilities.

20.2.2 Enqueue—Using a JMS JCA Adapter or Custom Utilities

The properties used by the AQ and JMS utilities are translated internally before the message is sent to the destination. Ensure that the properties in Table 20-4 are set as part of the javax.jms.Message delivered to the destination that B2B listens on.

Table 20-4 How AQ/JMS Properties Are Translated for Custom Utilities

AQ/JMS Utilities Translated Value—For Custom Utilities JMS Message

from

FROM_PARTY

Sent as a string type message property

to

TO_PARTY

Sent as a string type message property

doctypeName

DOCTYPE_NAME

Sent as a string type message property

doctypeRevision

DOCTYPE_REVISION

Sent as a string type message property

eventName

ACTION_NAME

Sent as a string type message property

msgID

MSG_ID

Sent as a string type message property

replyToMsgID

INREPLYTO_MSG_ID

Sent as a string type message property

msgType

MSG_TYPE

Sent as a string type message property

attachment

ATTACHMENT

Sent as a string type message property

payload

-

Sent as the message body


20.2.3 JMS Dequeue

This utility receives messages from the destination. The count property can be specified to control the number of messages to be picked up from the destination. Retrieved messages are written to the file JMSDequeue.txt at the current path (where you run the utility).

See the sample documentation for how to run these utilities.

Example 20-2 shows the sample JMS dequeue properties file.

Example 20-2 Sample jms_dequeue.properties File

####### Destination Details#######
destination = jms/b2b/B2B_IN_QUEUE
cf = jms/b2b/B2BQueueConnectionFactory
count=1

####### Server and Factory Details #######
factory=weblogic.jndi.WLInitialContextFactory
url=t3://stacz36:8001/
#user=<uncomment and provide your username>
#password=<uncomment and provide your password if required>