com.ibm.websphere.webmsg.publisher.jndijms

Class JmsPublisher

  1. java.lang.Object
  2. extended bycom.ibm.websphere.webmsg.publisher.jndijms.JmsPublisher
All implemented interfaces:
Publisher

  1. public class JmsPublisher
  2. extends java.lang.Object
  3. implements Publisher
Publisher implementation that uses a JMS ConnectionFactory to propagate messages. The ConnectionFactory is configured as a JNDI administered object, the key to which is passed in as a context parameter. JNDI lookup occurs during initialization. For every publish operation, a connection, session and producer is created and closed. (JCA Connection pooling should alleviate some of the weight of those operations). This should push some of the connection management issues back to the JCA container and remove some any threading concerns when using this class. Long property PROPERTY_MAX_CONNECT_TIME, if > 0, will indicate the publish request should be retried accord to duration set by Long property CONNECT_DELAY_INTERVAL (duration multiplied by Integer value specified by property PROPERTY_CONN_DELAY_MULTIPLIER). This could help in a clustered environment when an ME fails over.

Field Summary

Modifier and Type Field and Description
  1. static
  2. java.lang.String
EVENT_HEADER_ATTRIBUTE_NAME_JMS_DELIVERY_MODE
  1. static
  2. java.lang.String
EVENT_HEADER_ATTRIBUTE_NAME_JMS_PRIORITY
  1. static
  2. java.lang.String
EVENT_HEADER_ATTRIBUTE_NAME_JMS_TIME_TO_LIVE
  1. static
  2. java.lang.String
PROPERTY_CONN_DELAY_MULTIPLIER
  1. static
  2. java.lang.String
PROPERTY_CONN_DELAYINTERVAL
  1. static
  2. java.lang.String
PROPERTY_KEY_CONNECTION_FACTORY_JNDI_NAME
  1. static
  2. java.lang.String
PROPERTY_KEY_DEFAULT_DESTINATION
  1. static
  2. java.lang.String
PROPERTY_KEY_INITIAL_CONTEXT_FACTORY
  1. static
  2. java.lang.String
PROPERTY_KEY_JMS_CLIENT_ID
  1. static
  2. java.lang.String
PROPERTY_KEY_PROVIDER_URL
  1. static
  2. java.lang.String
PROPERTY_MAX_CONNECT_TIME

Constructor Summary

Constructor and Description
JmsPublisher()
Constructor

Method Summary

Modifier and Type Method and Description
  1. void
close()
  1. void
initialize(PublisherContext context)
Context attribute CONNECTION_FACTORY_JNDI_NAME is mandatory and it contains the String key with which to look up the ConnectionFactory from JMS.
  1. void
publish(WebMessage message)
Publish given WebMessage.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail

PROPERTY_KEY_CONNECTION_FACTORY_JNDI_NAME

  1. public static final java.lang.String PROPERTY_KEY_CONNECTION_FACTORY_JNDI_NAME
See Also:

PROPERTY_KEY_INITIAL_CONTEXT_FACTORY

  1. public static final java.lang.String PROPERTY_KEY_INITIAL_CONTEXT_FACTORY
See Also:

PROPERTY_KEY_PROVIDER_URL

  1. public static final java.lang.String PROPERTY_KEY_PROVIDER_URL
See Also:

PROPERTY_KEY_JMS_CLIENT_ID

  1. public static final java.lang.String PROPERTY_KEY_JMS_CLIENT_ID
See Also:

PROPERTY_KEY_DEFAULT_DESTINATION

  1. public static final java.lang.String PROPERTY_KEY_DEFAULT_DESTINATION
See Also:

EVENT_HEADER_ATTRIBUTE_NAME_JMS_DELIVERY_MODE

  1. public static final java.lang.String EVENT_HEADER_ATTRIBUTE_NAME_JMS_DELIVERY_MODE
See Also:

EVENT_HEADER_ATTRIBUTE_NAME_JMS_PRIORITY

  1. public static final java.lang.String EVENT_HEADER_ATTRIBUTE_NAME_JMS_PRIORITY
See Also:

EVENT_HEADER_ATTRIBUTE_NAME_JMS_TIME_TO_LIVE

  1. public static final java.lang.String EVENT_HEADER_ATTRIBUTE_NAME_JMS_TIME_TO_LIVE
See Also:

PROPERTY_MAX_CONNECT_TIME

  1. public static final java.lang.String PROPERTY_MAX_CONNECT_TIME
See Also:

PROPERTY_CONN_DELAYINTERVAL

  1. public static final java.lang.String PROPERTY_CONN_DELAYINTERVAL
See Also:

PROPERTY_CONN_DELAY_MULTIPLIER

  1. public static final java.lang.String PROPERTY_CONN_DELAY_MULTIPLIER
See Also:

Constructor Detail

JmsPublisher

  1. public JmsPublisher()
Constructor

Method Detail

initialize

  1. public void initialize(PublisherContext context)
  2. throws PublisherException
Context attribute CONNECTION_FACTORY_JNDI_NAME is mandatory and it contains the String key with which to look up the ConnectionFactory from JMS. Context attribute JMS_CLIENT_ID is optional and allows the specification of a particular JMS client ID for the connection. Optional JNDI InitialContext attributes are INITIAL_CONTEXT_FACTORY and PROVIDER_URL for additional JNDI configuration should it be required.
Specified by:
initialize in interface Publisher
Parameters:
context - - Context in which the publisher is running.
Throws:
PublisherException - - if there is initialization error.
See Also:

close

  1. public void close()
  2. throws PublisherException
Description copied from interface: Publisher
Close publisher, includes shutting down any connections, etc.
Specified by:
close in interface Publisher
Throws:
PublisherException - If error closing publisher.
See Also:

publish

  1. public void publish(WebMessage message)
  2. throws PublisherException
Publish given WebMessage. DeliveryMode, Priority, and time to live values come messages being published if set, if not defaults are used.
Specified by:
publish in interface Publisher
Parameters:
message - Message to be published.
Throws:
PublisherException - If there is any error with publishing the exception.
See Also: