Class ActiveMQConnectionFactory

java.lang.Object
org.apache.activemq.artemis.jndi.JNDIStorable
org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory
All Implemented Interfaces:
jakarta.jms.ConnectionFactory, jakarta.jms.XAConnectionFactory, Externalizable, Serializable, AutoCloseable, Referenceable, ConnectionFactoryOptions
Direct Known Subclasses:
ActiveMQJMSConnectionFactory, ActiveMQQueueConnectionFactory, ActiveMQTopicConnectionFactory, ActiveMQXAConnectionFactory, ActiveMQXAQueueConnectionFactory, ActiveMQXATopicConnectionFactory

public class ActiveMQConnectionFactory extends JNDIStorable implements ConnectionFactoryOptions, Externalizable, jakarta.jms.ConnectionFactory, jakarta.jms.XAConnectionFactory, AutoCloseable
ActiveMQ Artemis implementation of a JMS ConnectionFactory.

This connection factory will use defaults defined by DefaultConnectionProperties.

See Also:
  • Constructor Details

    • ActiveMQConnectionFactory

      public ActiveMQConnectionFactory()
      This will use a default URI from DefaultConnectionProperties
    • ActiveMQConnectionFactory

      public ActiveMQConnectionFactory(String brokerURL)
    • ActiveMQConnectionFactory

      public ActiveMQConnectionFactory(String url, String user, String password)
      For compatibility and users used to this kind of constructor
    • ActiveMQConnectionFactory

      public ActiveMQConnectionFactory(ServerLocator serverLocator)
    • ActiveMQConnectionFactory

      public ActiveMQConnectionFactory(boolean ha, DiscoveryGroupConfiguration groupConfiguration)
    • ActiveMQConnectionFactory

      public ActiveMQConnectionFactory(boolean ha, TransportConfiguration... initialConnectors)
  • Method Details

    • writeExternal

      public void writeExternal(ObjectOutput out) throws IOException
      Specified by:
      writeExternal in interface Externalizable
      Throws:
      IOException
    • toURI

      public URI toURI() throws IOException
      Throws:
      IOException
    • getProtocolManagerFactoryStr

      public String getProtocolManagerFactoryStr()
    • setProtocolManagerFactoryStr

      public void setProtocolManagerFactoryStr(String protocolManagerFactoryStr)
    • getDeserializationBlackList

      @Deprecated(forRemoval=true) public String getDeserializationBlackList()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getDeserializationBlackList in interface ConnectionFactoryOptions
    • setDeserializationBlackList

      @Deprecated(forRemoval=true) public void setDeserializationBlackList(String denyList)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      setDeserializationBlackList in interface ConnectionFactoryOptions
    • getDeserializationWhiteList

      @Deprecated(forRemoval=true) public String getDeserializationWhiteList()
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      getDeserializationWhiteList in interface ConnectionFactoryOptions
    • setDeserializationWhiteList

      @Deprecated(forRemoval=true) public void setDeserializationWhiteList(String allowList)
      Deprecated, for removal: This API element is subject to removal in a future version.
      Specified by:
      setDeserializationWhiteList in interface ConnectionFactoryOptions
    • getDeserializationDenyList

      public String getDeserializationDenyList()
      Specified by:
      getDeserializationDenyList in interface ConnectionFactoryOptions
    • setDeserializationDenyList

      public void setDeserializationDenyList(String denyList)
      Specified by:
      setDeserializationDenyList in interface ConnectionFactoryOptions
    • getDeserializationAllowList

      public String getDeserializationAllowList()
      Specified by:
      getDeserializationAllowList in interface ConnectionFactoryOptions
    • setDeserializationAllowList

      public void setDeserializationAllowList(String allowList)
      Specified by:
      setDeserializationAllowList in interface ConnectionFactoryOptions
    • readExternal

      public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
      Specified by:
      readExternal in interface Externalizable
      Throws:
      IOException
      ClassNotFoundException
    • setBrokerURL

      public void setBrokerURL(String brokerURL) throws jakarta.jms.JMSException
      Warning: This method will not clear any previous properties. For example, if you set the user first then you change the brokerURL without passing the user. The previously set user will still exist, and nothing will clear it out.

      Also, you cannot use this method after this ConnectionFactory is made readOnly which happens after the first time it's used to create a connection.

      Throws:
      jakarta.jms.JMSException
    • createConnection

      public jakarta.jms.Connection createConnection() throws jakarta.jms.JMSException
      Specified by:
      createConnection in interface jakarta.jms.ConnectionFactory
      Throws:
      jakarta.jms.JMSException
    • createConnection

      public jakarta.jms.Connection createConnection(String username, String password) throws jakarta.jms.JMSException
      Specified by:
      createConnection in interface jakarta.jms.ConnectionFactory
      Throws:
      jakarta.jms.JMSException
    • createContext

      public jakarta.jms.JMSContext createContext()
      Specified by:
      createContext in interface jakarta.jms.ConnectionFactory
    • createContext

      public jakarta.jms.JMSContext createContext(int sessionMode)
      Specified by:
      createContext in interface jakarta.jms.ConnectionFactory
    • createContext

      public jakarta.jms.JMSContext createContext(String userName, String password)
      Specified by:
      createContext in interface jakarta.jms.ConnectionFactory
    • createContext

      public jakarta.jms.JMSContext createContext(String userName, String password, int sessionMode)
      Specified by:
      createContext in interface jakarta.jms.ConnectionFactory
    • createQueueConnection

      public jakarta.jms.QueueConnection createQueueConnection() throws jakarta.jms.JMSException
      Throws:
      jakarta.jms.JMSException
    • createQueueConnection

      public jakarta.jms.QueueConnection createQueueConnection(String username, String password) throws jakarta.jms.JMSException
      Throws:
      jakarta.jms.JMSException
    • createTopicConnection

      public jakarta.jms.TopicConnection createTopicConnection() throws jakarta.jms.JMSException
      Throws:
      jakarta.jms.JMSException
    • createTopicConnection

      public jakarta.jms.TopicConnection createTopicConnection(String username, String password) throws jakarta.jms.JMSException
      Throws:
      jakarta.jms.JMSException
    • createXAConnection

      public jakarta.jms.XAConnection createXAConnection() throws jakarta.jms.JMSException
      Specified by:
      createXAConnection in interface jakarta.jms.XAConnectionFactory
      Throws:
      jakarta.jms.JMSException
    • createXAConnection

      public jakarta.jms.XAConnection createXAConnection(String username, String password) throws jakarta.jms.JMSException
      Specified by:
      createXAConnection in interface jakarta.jms.XAConnectionFactory
      Throws:
      jakarta.jms.JMSException
    • createXAContext

      public jakarta.jms.XAJMSContext createXAContext()
      Specified by:
      createXAContext in interface jakarta.jms.XAConnectionFactory
    • createXAContext

      public jakarta.jms.XAJMSContext createXAContext(String userName, String password)
      Specified by:
      createXAContext in interface jakarta.jms.XAConnectionFactory
    • createXAQueueConnection

      public jakarta.jms.XAQueueConnection createXAQueueConnection() throws jakarta.jms.JMSException
      Throws:
      jakarta.jms.JMSException
    • createXAQueueConnection

      public jakarta.jms.XAQueueConnection createXAQueueConnection(String username, String password) throws jakarta.jms.JMSException
      Throws:
      jakarta.jms.JMSException
    • createXATopicConnection

      public jakarta.jms.XATopicConnection createXATopicConnection() throws jakarta.jms.JMSException
      Throws:
      jakarta.jms.JMSException
    • createXATopicConnection

      public jakarta.jms.XATopicConnection createXATopicConnection(String username, String password) throws jakarta.jms.JMSException
      Throws:
      jakarta.jms.JMSException
    • buildFromProperties

      protected void buildFromProperties(Properties props)
      Description copied from class: JNDIStorable
      Set the properties that will represent the instance in JNDI
      Specified by:
      buildFromProperties in class JNDIStorable
      Parameters:
      props - The properties to use when building the new isntance.
    • populateProperties

      protected void populateProperties(Properties props)
      Description copied from class: JNDIStorable
      Initialize the instance from properties stored in JNDI
      Specified by:
      populateProperties in class JNDIStorable
      Parameters:
      props - The properties to use when initializing the new instance.
    • isHA

      public boolean isHA()
    • getConnectionLoadBalancingPolicyClassName

      public String getConnectionLoadBalancingPolicyClassName()
    • setConnectionLoadBalancingPolicyClassName

      public void setConnectionLoadBalancingPolicyClassName(String connectionLoadBalancingPolicyClassName)
    • getStaticConnectors

      public TransportConfiguration[] getStaticConnectors()
    • getDiscoveryGroupConfiguration

      public DiscoveryGroupConfiguration getDiscoveryGroupConfiguration()
    • getClientID

      public String getClientID()
    • setClientID

      public void setClientID(String clientID)
    • isEnableSharedClientID

      public boolean isEnableSharedClientID()
    • setEnableSharedClientID

      public void setEnableSharedClientID(boolean enableSharedClientID)
    • getDupsOKBatchSize

      public int getDupsOKBatchSize()
    • setDupsOKBatchSize

      public void setDupsOKBatchSize(int dupsOKBatchSize)
    • getTransactionBatchSize

      public int getTransactionBatchSize()
    • setTransactionBatchSize

      public void setTransactionBatchSize(int transactionBatchSize)
    • isCacheDestinations

      public boolean isCacheDestinations()
    • setCacheDestinations

      public void setCacheDestinations(boolean cacheDestinations)
    • isEnable1xPrefixes

      public boolean isEnable1xPrefixes()
    • setEnable1xPrefixes

      public void setEnable1xPrefixes(boolean enable1xPrefixes)
    • getClientFailureCheckPeriod

      public long getClientFailureCheckPeriod()
    • setClientFailureCheckPeriod

      public void setClientFailureCheckPeriod(long clientFailureCheckPeriod)
    • getConnectionTTL

      public long getConnectionTTL()
    • setConnectionTTL

      public void setConnectionTTL(long connectionTTL)
    • getCallTimeout

      public long getCallTimeout()
    • setCallTimeout

      public void setCallTimeout(long callTimeout)
    • getCallFailoverTimeout

      public long getCallFailoverTimeout()
    • setCallFailoverTimeout

      public void setCallFailoverTimeout(long callTimeout)
    • setUseTopologyForLoadBalancing

      public void setUseTopologyForLoadBalancing(boolean useTopologyForLoadBalancing)
    • isUseTopologyForLoadBalancing

      public boolean isUseTopologyForLoadBalancing()
    • getConsumerWindowSize

      public int getConsumerWindowSize()
    • setConsumerWindowSize

      public void setConsumerWindowSize(int consumerWindowSize)
    • getConsumerMaxRate

      public int getConsumerMaxRate()
    • setConsumerMaxRate

      public void setConsumerMaxRate(int consumerMaxRate)
    • getConfirmationWindowSize

      public int getConfirmationWindowSize()
    • setConfirmationWindowSize

      public void setConfirmationWindowSize(int confirmationWindowSize)
    • getProducerMaxRate

      public int getProducerMaxRate()
    • setProducerMaxRate

      public void setProducerMaxRate(int producerMaxRate)
    • getProducerWindowSize

      public int getProducerWindowSize()
    • setProducerWindowSize

      public void setProducerWindowSize(int producerWindowSize)
    • setCacheLargeMessagesClient

      public void setCacheLargeMessagesClient(boolean cacheLargeMessagesClient)
    • isCacheLargeMessagesClient

      public boolean isCacheLargeMessagesClient()
    • getMinLargeMessageSize

      public int getMinLargeMessageSize()
    • setMinLargeMessageSize

      public void setMinLargeMessageSize(int minLargeMessageSize)
    • isBlockOnAcknowledge

      public boolean isBlockOnAcknowledge()
    • setBlockOnAcknowledge

      public void setBlockOnAcknowledge(boolean blockOnAcknowledge)
    • isBlockOnNonDurableSend

      public boolean isBlockOnNonDurableSend()
    • setBlockOnNonDurableSend

      public void setBlockOnNonDurableSend(boolean blockOnNonDurableSend)
    • isBlockOnDurableSend

      public boolean isBlockOnDurableSend()
    • setBlockOnDurableSend

      public void setBlockOnDurableSend(boolean blockOnDurableSend)
    • isAutoGroup

      public boolean isAutoGroup()
    • setAutoGroup

      public void setAutoGroup(boolean autoGroup)
    • isPreAcknowledge

      public boolean isPreAcknowledge()
    • setPreAcknowledge

      public void setPreAcknowledge(boolean preAcknowledge)
    • getRetryInterval

      public long getRetryInterval()
    • setRetryInterval

      public void setRetryInterval(long retryInterval)
    • getMaxRetryInterval

      public long getMaxRetryInterval()
    • setMaxRetryInterval

      public void setMaxRetryInterval(long retryInterval)
    • getRetryIntervalMultiplier

      public double getRetryIntervalMultiplier()
    • setRetryIntervalMultiplier

      public void setRetryIntervalMultiplier(double retryIntervalMultiplier)
    • getReconnectAttempts

      public int getReconnectAttempts()
    • setReconnectAttempts

      public void setReconnectAttempts(int reconnectAttempts)
    • setInitialConnectAttempts

      public void setInitialConnectAttempts(int reconnectAttempts)
    • getInitialConnectAttempts

      public int getInitialConnectAttempts()
    • isFailoverOnInitialConnection

      @Deprecated public boolean isFailoverOnInitialConnection()
      Deprecated.
    • setFailoverOnInitialConnection

      @Deprecated public void setFailoverOnInitialConnection(boolean failover)
      Deprecated.
    • isUseGlobalPools

      public boolean isUseGlobalPools()
    • setUseGlobalPools

      public void setUseGlobalPools(boolean useGlobalPools)
    • getScheduledThreadPoolMaxSize

      public int getScheduledThreadPoolMaxSize()
    • setScheduledThreadPoolMaxSize

      public void setScheduledThreadPoolMaxSize(int scheduledThreadPoolMaxSize)
    • getThreadPoolMaxSize

      public int getThreadPoolMaxSize()
    • setThreadPoolMaxSize

      public void setThreadPoolMaxSize(int threadPoolMaxSize)
    • getInitialMessagePacketSize

      public int getInitialMessagePacketSize()
    • setInitialMessagePacketSize

      public void setInitialMessagePacketSize(int size)
    • isIgnoreJTA

      public boolean isIgnoreJTA()
    • setIgnoreJTA

      public void setIgnoreJTA(boolean ignoreJTA)
    • setIncomingInterceptorList

      public void setIncomingInterceptorList(String interceptorList)
      Set the list of Interceptors to use for incoming packets.
      Parameters:
      interceptorList - a comma separated string of incoming interceptor class names to be used. Each interceptor needs a default Constructor to be used with this method.
    • getIncomingInterceptorList

      public String getIncomingInterceptorList()
    • setOutgoingInterceptorList

      public void setOutgoingInterceptorList(String interceptorList)
      Set the list of Interceptors to use for outgoing packets.
      Parameters:
      interceptorList - a comma separated string of incoming interceptor class names to be used. Each interceptor needs a default Constructor to be used with this method.
    • getOutgoingInterceptorList

      public String getOutgoingInterceptorList()
    • setUser

      public ActiveMQConnectionFactory setUser(String user)
    • getUser

      public String getUser()
    • getPassword

      public String getPassword()
    • setPassword

      public ActiveMQConnectionFactory setPassword(String password)
    • getPasswordCodec

      public String getPasswordCodec()
    • setPasswordCodec

      public ActiveMQConnectionFactory setPasswordCodec(String passwordCodec)
    • setGroupID

      public void setGroupID(String groupID)
    • getGroupID

      public String getGroupID()
    • isCompressLargeMessage

      public boolean isCompressLargeMessage()
    • setCompressLargeMessage

      public void setCompressLargeMessage(boolean avoidLargeMessages)
    • getCompressionLevel

      public int getCompressionLevel()
    • setCompressionLevel

      public void setCompressionLevel(int compressionLevel)
    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • getServerLocator

      public ServerLocator getServerLocator()
    • getFactoryType

      public int getFactoryType()
    • createConnectionInternal

      protected ActiveMQConnection createConnectionInternal(String username, String password, boolean isXA, int type) throws jakarta.jms.JMSException
      Throws:
      jakarta.jms.JMSException
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • makeReadOnly

      protected void makeReadOnly()