SonicMQ API

progress.message.jclient.mp
Class ConnectionFactory

java.lang.Object
  extended by progress.message.jclient.mp.ConnectionFactory
All Implemented Interfaces:
java.io.Serializable, ConnectionFactory, javax.naming.Referenceable, javax.naming.spi.ObjectFactory
Direct Known Subclasses:
QueueConnectionFactory, TopicConnectionFactory

public class ConnectionFactory
extends java.lang.Object
implements ConnectionFactory, java.io.Serializable, javax.naming.Referenceable, javax.naming.spi.ObjectFactory

Title: SonicMQ Adaptive Pacing (Managed Client Connection Factory)

Description: Managed Clients are JMS Client connections that provide an additional set of functions for managing or working with connections, sessions, destinations, producers and consumers of messages. Managed Pipes (MP connections) also add a number of enhancements to the standard SonicMQ JMS client which are listed below. MP is implemented as a set of overlay classes on top of the standard progress.message.jclient.* package using a delegate class pattern.

The following additional features are available as part of the extended functionality:

Build 28

Copyright: Copyright (c) 2006

Company: Progress Software

Version:
2.2
Author:
Dmitry Lelchuk
See Also:
Serialized Form

Constructor Summary
ConnectionFactory()
           
ConnectionFactory(java.lang.String brokerURL)
           
ConnectionFactory(java.lang.String brokerHostName, int brokerPort, java.lang.String brokerProtocol, java.lang.String defaultUserName, java.lang.String defaultPassword)
           
ConnectionFactory(java.lang.String brokerHostName, int brokerPort, java.lang.String brokerProtocol, java.lang.String connectID, java.lang.String defaultUserName, java.lang.String defaultPassword)
           
ConnectionFactory(java.lang.String brokerURL, java.lang.String connectID)
           
ConnectionFactory(java.lang.String brokerURL, java.lang.String defaultUserName, java.lang.String defaultPassword)
           
ConnectionFactory(java.lang.String brokerURL, java.lang.String connectID, java.lang.String defaultUserName, java.lang.String defaultPassword)
           
 
Method Summary
 Connection createConnection()
          Creates a Connection with the default user identity.
 Connection createConnection(java.lang.String userid, java.lang.String password)
          Creates a new Connection with the specified user identity.
 boolean getAdaptivePacing()
          Get status of Adaptive Pacing for this Connection Factory as boolean.
 int getAdaptivePacingBatchSize()
          Get the Adaptive Pacing message Batch Size as integer.
 java.lang.Integer getAdaptivePacingBatchSizeInteger()
          Get the Adaptive Pacing message Batch Size as java.lang.Integer.
 java.lang.Boolean getAdaptivePacingBoolean()
          Get status of Adaptive Pacing for this Connection Factory as java.lang.Boolean.
 int getAdaptivePacingTimer()
          Get the Adaptive Pacing Timer interval in milliseconds as integer.
 java.lang.Integer getAdaptivePacingTimerInteger()
          Get the Adaptive Pacing Timer interval in milliseconds as java.lang.Integer.
 java.applet.Applet getApplet()
           
 java.lang.String getBrokerHostName()
           
 int getBrokerPort()
           
 java.lang.String getBrokerProtocol()
           
 java.lang.String getBrokerURL()
           
 java.lang.String getClientID()
           
 java.lang.Long getClientTransactionBufferSize()
           
 java.lang.String getConnectID()
           
 java.lang.String getConnectionURLs()
           
 java.lang.String getDefaultPassword()
           
 int getDefaultTxnBatchSize()
           
 java.lang.Integer getDefaultTxnBatchSizeInteger()
           
 java.lang.String getDefaultUser()
           
 java.lang.Boolean getDurableMessageOrder()
           
 java.lang.Boolean getFaultTolerant()
           
 java.lang.Integer getFaultTolerantReconnectTimeout()
           
 java.lang.Integer getFlowToDisk()
           
 java.lang.Integer getInitialConnectTimeout()
           
 boolean getLoadBalancing()
           
 java.lang.Boolean getLoadBalancingBoolean()
           
 java.lang.String getLocalStoreDirectory()
           
 long getLocalStoreSize()
           
 java.lang.Long getLocalStoreSizeLong()
           
 java.lang.Integer getLocalStoreWaitTime()
           
 java.lang.String getLoginSPI()
           
 java.lang.Integer getMaxDeliveryCount()
           
 java.lang.Integer getMonitorInterval()
           
 java.lang.Object getObjectInstance(java.lang.Object obj, javax.naming.Name objName, javax.naming.Context nameCtx, java.util.Hashtable env)
           
 boolean getPersistentDelivery()
           
 java.lang.Boolean getPersistentDeliveryBoolean()
           
 long getPingInterval()
           
 java.lang.Long getPingIntervalLong()
           
 int getPrefetchCount()
           
 java.lang.Integer getPrefetchCountInteger()
           
 int getPrefetchThreshold()
           
 java.lang.Integer getPrefetchThresholdInteger()
           
 java.lang.Integer getQopCacheSize()
           
 int getReconnectInterval()
           
 java.lang.Integer getReconnectIntervalInteger()
           
 int getReconnectTimeout()
           
 java.lang.Integer getReconnectTimeoutInteger()
           
 javax.naming.Reference getReference()
           
 java.lang.Boolean getSelectorAtBroker()
           
 boolean getSequential()
           
 java.lang.Boolean getSequentialBoolean()
           
 java.lang.Integer getSocketConnectTimeout()
           
 java.lang.Boolean getSplitMultiTopicDelivery()
           
 java.lang.String getUrlsOrUrl()
           
 boolean isEnableLocalStore()
           
 java.lang.Boolean isEnableLocalStoreBoolean()
           
 void setAdaptivePacing(java.lang.Boolean enableAdaptivePacing)
          Enable Adaptive Pacing as default on Connections created by this factory.
 void setAdaptivePacingBatchSize(java.lang.Integer adaptivePacingBatchSize)
          Set the Adaptive Pacing message Batch Size.
 void setAdaptivePacingTimer(java.lang.Integer adaptivePacingTimer)
          Set the Adaptive Pacing Timer interval in milliseconds.
 void setApplet(java.applet.Applet applet)
           
 void setBrokerHostName(java.lang.String brokerHostName)
           
 void setBrokerPort(int brokerPort)
           
 void setBrokerProtocol(java.lang.String brokerProtocol)
           
 void setBrokerURL(java.lang.String brokerURL)
           
 void setClientID(java.lang.String clientID)
           
 void setClientTransactionBufferSize(java.lang.Long size)
           
 void setConnectID(java.lang.String connectID)
           
 void setConnectionURLs(java.lang.String brokerList)
           
 void setDefaultPassword(java.lang.String password)
           
 void setDefaultTxnBatchSize(int size)
           
 void setDefaultTxnBatchSizeInteger(java.lang.Integer size)
           
 void setDefaultUser(java.lang.String username)
           
 void setDurableMessageOrder(java.lang.Boolean durableSubscriberMessageOrder)
           
 void setEnableLocalStore(boolean value)
           
 void setEnableLocalStoreBoolean(java.lang.Boolean value)
           
 void setFaultTolerant(java.lang.Boolean faultTolerant)
           
 void setFaultTolerantReconnectTimeout(java.lang.Integer seconds)
           
 void setFlowToDisk(java.lang.Integer flag)
           
 void setInitialConnectTimeout(java.lang.Integer seconds)
           
 void setLoadBalancing(boolean loadBalancing)
           
 void setLoadBalancingBoolean(java.lang.Boolean loadBalancing)
           
 void setLocalStoreDirectory(java.lang.String name)
           
 void setLocalStoreSize(long size)
           
 void setLocalStoreSizeLong(java.lang.Long size)
           
 void setLocalStoreWaitTime(java.lang.Integer secs)
           
 void setLoginSPI(java.lang.String className)
           
 void setMaxDeliveryCount(java.lang.Integer value)
           
 void setMonitorInterval(java.lang.Integer interval)
           
 void setPersistentDelivery(boolean persistentDelivery)
           
 void setPersistentDeliveryBoolean(java.lang.Boolean persistentDelivery)
           
 void setPingInterval(long interval)
           
 void setPingIntervalLong(java.lang.Long interval)
           
 void setPrefetchCount(int count)
           
 void setPrefetchCountInteger(java.lang.Integer count)
           
 void setPrefetchThreshold(int val)
           
 void setPrefetchThresholdInteger(java.lang.Integer val)
           
 void setQopCacheSize(java.lang.Integer value)
           
 void setReconnectInterval(int secs)
           
 void setReconnectIntervalInteger(java.lang.Integer secs)
           
 void setReconnectTimeout(int minutes)
           
 void setReconnectTimeoutInteger(java.lang.Integer minutes)
           
 void setSelectorAtBroker(java.lang.Boolean flag)
           
 void setSequential(boolean sequential)
           
 void setSequentialBoolean(java.lang.Boolean sequential)
           
 void setSocketConnectTimeout(java.lang.Integer socketConnectTimeout)
           
 void setSplitMultiTopicDelivery(java.lang.Boolean splitMultiTopicDelivery)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConnectionFactory

public ConnectionFactory()
                  throws JMSException
Throws:
JMSException

ConnectionFactory

public ConnectionFactory(java.lang.String brokerURL)
                  throws JMSException
Throws:
JMSException

ConnectionFactory

public ConnectionFactory(java.lang.String brokerHostName,
                         int brokerPort,
                         java.lang.String brokerProtocol,
                         java.lang.String defaultUserName,
                         java.lang.String defaultPassword)
                  throws JMSException
Throws:
JMSException

ConnectionFactory

public ConnectionFactory(java.lang.String brokerHostName,
                         int brokerPort,
                         java.lang.String brokerProtocol,
                         java.lang.String connectID,
                         java.lang.String defaultUserName,
                         java.lang.String defaultPassword)
                  throws JMSException
Throws:
JMSException

ConnectionFactory

public ConnectionFactory(java.lang.String brokerURL,
                         java.lang.String connectID)
                  throws JMSException
Throws:
JMSException

ConnectionFactory

public ConnectionFactory(java.lang.String brokerURL,
                         java.lang.String defaultUserName,
                         java.lang.String defaultPassword)
                  throws JMSException
Throws:
JMSException

ConnectionFactory

public ConnectionFactory(java.lang.String brokerURL,
                         java.lang.String connectID,
                         java.lang.String defaultUserName,
                         java.lang.String defaultPassword)
                  throws JMSException
Throws:
JMSException
Method Detail

createConnection

public Connection createConnection()
                            throws JMSException
Creates a Connection with the default user identity. The connection is created in stopped mode. No message will be delivered until the Connection.start method is explicitly called.

If Adaptive Pacing is enabled the Connection inherits these properties from the factory. Users should check the Linked Exception for additional reasons of failure.

Specified by:
createConnection in interface ConnectionFactory
Returns:
A newly created connection.
Throws:
JMSException - If the JMS provider fails to create the connection due to some internal error.
JMSSecurityException - If client authentication fails due to an invalid user name or password.
Since:
1.1

createConnection

public Connection createConnection(java.lang.String userid,
                                   java.lang.String password)
                            throws JMSException
Creates a new Connection with the specified user identity. The connection is created in stopped mode. No messages will be delivered until the Connection.start method is explicitly called.

If Adaptive Pacing is enabled the Connection inherits these properties from the factory. Users should check the Linked Exception for additional reasons of failure.

Specified by:
createConnection in interface ConnectionFactory
Parameters:
userid - The caller's user name.
password - The caller's password.
Returns:
A newly created connection.
Throws:
JMSException - If the JMS provider fails to create the connection due to some internal error.
JMSSecurityException - If client authentication fails due to an invalid user name or password.

getApplet

public java.applet.Applet getApplet()

getBrokerHostName

public java.lang.String getBrokerHostName()

getBrokerPort

public int getBrokerPort()

getBrokerProtocol

public java.lang.String getBrokerProtocol()

getBrokerURL

public java.lang.String getBrokerURL()

getClientID

public java.lang.String getClientID()

getClientTransactionBufferSize

public java.lang.Long getClientTransactionBufferSize()

getConnectID

public java.lang.String getConnectID()

getConnectionURLs

public java.lang.String getConnectionURLs()

getDefaultPassword

public java.lang.String getDefaultPassword()

getDefaultTxnBatchSize

public int getDefaultTxnBatchSize()

getDefaultTxnBatchSizeInteger

public java.lang.Integer getDefaultTxnBatchSizeInteger()

getDefaultUser

public java.lang.String getDefaultUser()

getDurableMessageOrder

public java.lang.Boolean getDurableMessageOrder()

getFaultTolerant

public java.lang.Boolean getFaultTolerant()

getFaultTolerantReconnectTimeout

public java.lang.Integer getFaultTolerantReconnectTimeout()

getFlowToDisk

public java.lang.Integer getFlowToDisk()

getInitialConnectTimeout

public java.lang.Integer getInitialConnectTimeout()

getLoadBalancing

public boolean getLoadBalancing()

getLoadBalancingBoolean

public java.lang.Boolean getLoadBalancingBoolean()

getLocalStoreDirectory

public java.lang.String getLocalStoreDirectory()

getLocalStoreSize

public long getLocalStoreSize()

getLocalStoreSizeLong

public java.lang.Long getLocalStoreSizeLong()

getLocalStoreWaitTime

public java.lang.Integer getLocalStoreWaitTime()

getLoginSPI

public java.lang.String getLoginSPI()

getMaxDeliveryCount

public java.lang.Integer getMaxDeliveryCount()

getMonitorInterval

public java.lang.Integer getMonitorInterval()

getPersistentDelivery

public boolean getPersistentDelivery()

getPersistentDeliveryBoolean

public java.lang.Boolean getPersistentDeliveryBoolean()

getPingInterval

public long getPingInterval()

getPingIntervalLong

public java.lang.Long getPingIntervalLong()

getPrefetchCount

public int getPrefetchCount()

getPrefetchCountInteger

public java.lang.Integer getPrefetchCountInteger()

getPrefetchThreshold

public int getPrefetchThreshold()

getPrefetchThresholdInteger

public java.lang.Integer getPrefetchThresholdInteger()

getQopCacheSize

public java.lang.Integer getQopCacheSize()

getReconnectInterval

public int getReconnectInterval()

getReconnectIntervalInteger

public java.lang.Integer getReconnectIntervalInteger()

getReconnectTimeout

public int getReconnectTimeout()

getReconnectTimeoutInteger

public java.lang.Integer getReconnectTimeoutInteger()

getReference

public javax.naming.Reference getReference()
                                    throws javax.naming.NamingException
Specified by:
getReference in interface javax.naming.Referenceable
Throws:
javax.naming.NamingException

getObjectInstance

public java.lang.Object getObjectInstance(java.lang.Object obj,
                                          javax.naming.Name objName,
                                          javax.naming.Context nameCtx,
                                          java.util.Hashtable env)
                                   throws java.lang.Exception
Specified by:
getObjectInstance in interface javax.naming.spi.ObjectFactory
Throws:
java.lang.Exception

getSelectorAtBroker

public java.lang.Boolean getSelectorAtBroker()

getSequential

public boolean getSequential()

getSequentialBoolean

public java.lang.Boolean getSequentialBoolean()

getSocketConnectTimeout

public java.lang.Integer getSocketConnectTimeout()

getSplitMultiTopicDelivery

public java.lang.Boolean getSplitMultiTopicDelivery()

getUrlsOrUrl

public java.lang.String getUrlsOrUrl()

isEnableLocalStore

public boolean isEnableLocalStore()

isEnableLocalStoreBoolean

public java.lang.Boolean isEnableLocalStoreBoolean()

setApplet

public void setApplet(java.applet.Applet applet)

setBrokerHostName

public void setBrokerHostName(java.lang.String brokerHostName)

setBrokerPort

public void setBrokerPort(int brokerPort)

setBrokerProtocol

public void setBrokerProtocol(java.lang.String brokerProtocol)

setBrokerURL

public void setBrokerURL(java.lang.String brokerURL)

setClientID

public void setClientID(java.lang.String clientID)
                 throws JMSException
Throws:
JMSException

setClientTransactionBufferSize

public void setClientTransactionBufferSize(java.lang.Long size)

setConnectID

public void setConnectID(java.lang.String connectID)

setConnectionURLs

public void setConnectionURLs(java.lang.String brokerList)

setDefaultPassword

public void setDefaultPassword(java.lang.String password)

setDefaultTxnBatchSize

public void setDefaultTxnBatchSize(int size)

setDefaultTxnBatchSizeInteger

public void setDefaultTxnBatchSizeInteger(java.lang.Integer size)

setDefaultUser

public void setDefaultUser(java.lang.String username)

setDurableMessageOrder

public void setDurableMessageOrder(java.lang.Boolean durableSubscriberMessageOrder)

setEnableLocalStore

public void setEnableLocalStore(boolean value)

setEnableLocalStoreBoolean

public void setEnableLocalStoreBoolean(java.lang.Boolean value)

setFaultTolerant

public void setFaultTolerant(java.lang.Boolean faultTolerant)

setFaultTolerantReconnectTimeout

public void setFaultTolerantReconnectTimeout(java.lang.Integer seconds)

setFlowToDisk

public void setFlowToDisk(java.lang.Integer flag)

setInitialConnectTimeout

public void setInitialConnectTimeout(java.lang.Integer seconds)

setLoadBalancing

public void setLoadBalancing(boolean loadBalancing)

setLoadBalancingBoolean

public void setLoadBalancingBoolean(java.lang.Boolean loadBalancing)

setLocalStoreDirectory

public void setLocalStoreDirectory(java.lang.String name)

setLocalStoreSize

public void setLocalStoreSize(long size)

setLocalStoreSizeLong

public void setLocalStoreSizeLong(java.lang.Long size)

setLocalStoreWaitTime

public void setLocalStoreWaitTime(java.lang.Integer secs)

setLoginSPI

public void setLoginSPI(java.lang.String className)

setMaxDeliveryCount

public void setMaxDeliveryCount(java.lang.Integer value)

setMonitorInterval

public void setMonitorInterval(java.lang.Integer interval)

setPersistentDelivery

public void setPersistentDelivery(boolean persistentDelivery)

setPersistentDeliveryBoolean

public void setPersistentDeliveryBoolean(java.lang.Boolean persistentDelivery)

setPingInterval

public void setPingInterval(long interval)

setPingIntervalLong

public void setPingIntervalLong(java.lang.Long interval)

setPrefetchCount

public void setPrefetchCount(int count)

setPrefetchCountInteger

public void setPrefetchCountInteger(java.lang.Integer count)

setPrefetchThreshold

public void setPrefetchThreshold(int val)

setPrefetchThresholdInteger

public void setPrefetchThresholdInteger(java.lang.Integer val)

setQopCacheSize

public void setQopCacheSize(java.lang.Integer value)

setReconnectInterval

public void setReconnectInterval(int secs)

setReconnectIntervalInteger

public void setReconnectIntervalInteger(java.lang.Integer secs)

setReconnectTimeout

public void setReconnectTimeout(int minutes)

setReconnectTimeoutInteger

public void setReconnectTimeoutInteger(java.lang.Integer minutes)

setSelectorAtBroker

public void setSelectorAtBroker(java.lang.Boolean flag)

setSequential

public void setSequential(boolean sequential)

setSequentialBoolean

public void setSequentialBoolean(java.lang.Boolean sequential)

setSocketConnectTimeout

public void setSocketConnectTimeout(java.lang.Integer socketConnectTimeout)

setSplitMultiTopicDelivery

public void setSplitMultiTopicDelivery(java.lang.Boolean splitMultiTopicDelivery)

setAdaptivePacing

public void setAdaptivePacing(java.lang.Boolean enableAdaptivePacing)
Enable Adaptive Pacing as default on Connections created by this factory. Adaptive Pacing implements adaptive message batching for non-transactional Sessions (it effectivley turns such sessions into transacted) to effect a more efficient message exchange between Message Producers and the Broker. Note that send operations still occur synchronously. Adaptive Pacing uses a two stage approach to efficiently group send operations. Messages are buffered by the client until they reach a set batch size. When the batch is full messages are sent to the broker in a single exchange. Additionaly a background thread spins on a timer waiting for a time slice to expire. When the time interval elapses all outstanding messages are also sent to the broker.

The two strategies work in tandem facilitating adaptive client-side flow control for Message Producers. When producer rates are high the send buffer fills quickly and the timer's scheduled sends are bypassed since the buffer typically fills in less time then the scheduled interval. When message rates drop, scheduled sending takes precedence, allowing outstanding messges to be delivered before the buffer fills. Likewise, when message rates are unpredictable the two strategies facilitate adaptive, predictable performance.

Sizing the correct values is important since seting wait intervals or buffers too large may result in unwanted latency, while setting these values too high will result in an increased amount of outstanding acknowledgements on the wire. A usefull excercise may be to set a batch of 10 messages and test varying settings for timer intervals to asses the break-even point at which larger timer intervals no longer improve performance of the Message Producer. The derived value will also represent the avarage latency of your chosen batch size.

The default is false.

Parameters:
enableAdaptivePacing - Enable Adaptive Pacing as default on this Connection Factory.

getAdaptivePacing

public boolean getAdaptivePacing()
Get status of Adaptive Pacing for this Connection Factory as boolean.

Returns:
Status of Adaptive Pacing as boolean.

getAdaptivePacingBoolean

public java.lang.Boolean getAdaptivePacingBoolean()
Get status of Adaptive Pacing for this Connection Factory as java.lang.Boolean.

Returns:
Status of Adaptive Pacing as java.lang.Boolean.

setAdaptivePacingTimer

public void setAdaptivePacingTimer(java.lang.Integer adaptivePacingTimer)
Set the Adaptive Pacing Timer interval in milliseconds. Adaptive Pacing uses two mechanisms for optimizing Message Producer send operations. A configurable transmission buffer is used to hold in-flight messages which are transmited as a single 'transaction'. This tends to work well when fast, steady producer rates are acheived. As message rates drop, however, waiting for the buffer to fill may introduce unwanted latency. To address this a second mechanism is utilized allowing the buffer to flush when a given timer interval expires. The default value is 2 milliseconds.

Parameters:
adaptivePacingTimer - Adaptive Pacing Timer interval in milliseconds.

getAdaptivePacingTimer

public int getAdaptivePacingTimer()
Get the Adaptive Pacing Timer interval in milliseconds as integer.

Returns:
Adaptive Pacing Timer interval as integer.

getAdaptivePacingTimerInteger

public java.lang.Integer getAdaptivePacingTimerInteger()
Get the Adaptive Pacing Timer interval in milliseconds as java.lang.Integer.

Returns:
Adaptive Pacing Timer interval as java.lang.Integer.

setAdaptivePacingBatchSize

public void setAdaptivePacingBatchSize(java.lang.Integer adaptivePacingBatchSize)
Set the Adaptive Pacing message Batch Size. Adaptive Pacing uses two mechanisms for optimizing Message Producer send operations. A timer is used to periodically flush transmission buffers when send rates are low. A configurable transmission buffer is used to hold in-flight messages which are transmited as a single 'transaction batch' to the Broker. A message producer under load will automatically flush its transmission buffer when it becomes full. The default value is 10.

Parameters:
adaptivePacingBatchSize - Adaptive Pacing message Batch Size.

getAdaptivePacingBatchSize

public int getAdaptivePacingBatchSize()
Get the Adaptive Pacing message Batch Size as integer.

Returns:
Adaptive Pacing message Batch Size as integer.

getAdaptivePacingBatchSizeInteger

public java.lang.Integer getAdaptivePacingBatchSizeInteger()
Get the Adaptive Pacing message Batch Size as java.lang.Integer.

Returns:
Adaptive Pacing message Batch Size as java.lang.Integer

SonicMQ API

Copyright © 1999-2010 Progress Software Corporation. All Rights Reserved.
HTML formatted on 15-September-2010.