public class MessageSizeProducerSessionFactory extends ProducerSessionFactoryImpl
ProducerSessionFactory that creates a new session/producer based on message size.
This implementaton refreshes the session based on the total size of the messages produced.
In the adapter configuration file this class is aliased as jms-message-size-producer-session which is the preferred alternative to the fully qualified classname when building your configuration.
log, session| Constructor and Description |
|---|
MessageSizeProducerSessionFactory() |
MessageSizeProducerSessionFactory(java.lang.Long max) |
| Modifier and Type | Method and Description |
|---|---|
ProducerSession |
createProducerSession(JmsProducerImpl producer,
AdaptrisMessage msg)
Create or reuse an existing session.
|
java.lang.Long |
getMaxSizeBytes() |
void |
init()
Initialises the component.
|
void |
setMaxSizeBytes(java.lang.Long max)
Set the maximum accumulated size of messages before a session refresh is required.
|
close, closeQuietly, createProducerSessionclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitstart, stoppublic MessageSizeProducerSessionFactory()
public MessageSizeProducerSessionFactory(java.lang.Long max)
public ProducerSession createProducerSession(JmsProducerImpl producer, AdaptrisMessage msg) throws javax.jms.JMSException
ProducerSessionFactoryproducer - the JmsProducerImpl instancemsg - the message that the producer is currently handling.ProducerSessionjavax.jms.JMSException - if there was a problem creating the session.public void init()
throws CoreException
ComponentLifecycleComponent initialisation includes config verification, creation of connections etc.
init in interface ComponentLifecycleinit in class ProducerSessionFactoryImplCoreException - wrapping any underlying Exceptionspublic java.lang.Long getMaxSizeBytes()
public void setMaxSizeBytes(java.lang.Long max)
max - the max size of messages; if not specified, defaults to 10 megabytes.