WebSphere WebSphere Enterprise Service Bus, Version 6.0.1 Operating Systems: AIX, HP-UX, Linux, Solaris, Windows

Overriding the current emitter settings

Emitter factory profile settings can be changed by event consumers.

Why and when to perform this task

When sending an event, you can specify options that override the current transaction mode, synchronization mode, or both, currently configured for the emitter. These settings are initially defined by an administrator in the emitter factory profile, but they can later be changed by event consumers.

An emitter might not support all synchronization and transaction modes. The available modes are subject to the following limitations: If you attempt to use a mode that is not supported, the emitter throws a TransactionModeNotSupportedException or SynchronizationModeNotSupportedException exception.

Steps for this task

To override the emitter settings, use the sendEvent(CommonBaseEvent, int, int) method.
String eventId = emitter.sendEvent(event,
                                   synchronizationMode,
                                   transactionMode);
The parameters are as follows:
event
The event object (an instance of CommonBaseEvent) you want to send.
synchronizationMode
An integer constant defined by the interface SynchronizationMode. This should be one of the following constants:
  • SynchronizationMode.ASYNCHRONOUS (send the event asynchronously)
  • SynchronizationMode.SYNCHRONOUS (send the event synchronously)
  • SynchronizationMode.DEFAULT (use the current emitter setting)
transactionMode
An integer constant defined by the interface TransactionMode:
  • TransactionMode.NEW (send the event in a new transaction)
  • TransactionMode.SAME (send the event in the current transaction)
  • TransactionMode.DEFAULT (use the current emitter setting)

Result

The event is sent with the options you specify. These options apply only to the single event being sent; no changes are made to the emitter settings, and subsequent event submissions are not affected.

The returned value, eventId, is the globally unique identifier of the event (the value of the globalInstanceId field of CommonBaseEvent). If the event does not have a globalInstanceId when you submit it, the emitter assigns one automatically.

Note: Submitting an event to an emitter does not guarantee that the event is sent to the event server, because the filter settings might cause the event to be discarded. A successful call to sendEvent() means only that the event was successfully processed by the emitter.

Example

The following example overrides the emitter setting to send an event in a new transaction, but does not override the synchronization mode:
String eventId = sendEvent(event,
                           SynchronizationMode.DEFAULT,
                           TransactionMode.NEW);

Task topic

Terms of Use | Rate this page

Timestamp iconLast updated: 13 Dec 2005
http://publib.boulder.ibm.com/infocenter/dmndhelp/v6rxmx/index.jsp?topic=/com.ibm.websphere.wesb.doc\doc\tcei_admin_overrideEmitterSettings.html

(C) Copyright IBM Corporation 2005. All Rights Reserved.
This information center is powered by Eclipse technology. (http://www.eclipse.org)