Package org.apache.activemq.network.jms
Class OutboundQueueBridge
- java.lang.Object
-
- org.apache.activemq.network.jms.DestinationBridge
-
- org.apache.activemq.network.jms.OutboundQueueBridge
-
- All Implemented Interfaces:
MessageListener,Service
public class OutboundQueueBridge extends DestinationBridge
Create an Outbound Queue Bridge. By default the bridge uses the same name for both the inbound and outbound queues, however this can be altered by using the public setter methods to configure both inbound and outbound queue names.
-
-
Field Summary
Fields Modifier and Type Field Description protected QueueConnectionconsumerConnectionprotected QueueconsumerQueueprotected QueueSessionconsumerSessionprotected QueueSenderproducerprotected QueueConnectionproducerConnectionprotected QueueproducerQueueprotected QueueSessionproducerSessionprotected Stringselector-
Fields inherited from class org.apache.activemq.network.jms.DestinationBridge
consumer, doHandleReplyTo, jmsConnector, jmsMessageConvertor, started
-
-
Constructor Summary
Constructors Constructor Description OutboundQueueBridge()Default ConstructorOutboundQueueBridge(String outboundQueueName)Constructor that takes a foreign destination as an argument
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MessageConsumercreateConsumer()protected MessageProducercreateProducer()protected ConnectiongetConnectionForProducer()protected ConnectiongetConnnectionForConsumer()QueueConnectiongetConsumerConnection()QueuegetConsumerQueue()StringgetLocalQueueName()StringgetOutboundQueueName()QueueConnectiongetProducerConnection()QueuegetProducerQueue()StringgetSelector()protected voidsendMessage(Message message)voidsetConsumerConnection(QueueConnection consumerConnection)voidsetConsumerQueue(Queue consumerQueue)voidsetLocalQueueName(String localQueueName)voidsetOutboundQueueName(String outboundQueueName)Sets the name of the outbound queue name.voidsetProducerConnection(QueueConnection producerConnection)voidsetProducerQueue(Queue producerQueue)voidsetSelector(String selector)voidstop()-
Methods inherited from class org.apache.activemq.network.jms.DestinationBridge
getConsumer, getJmsMessageConvertor, isDoHandleReplyTo, onMessage, processReplyToDestination, setConsumer, setDoHandleReplyTo, setJmsConnector, setJmsMessageConvertor, start
-
-
-
-
Field Detail
-
consumerQueue
protected Queue consumerQueue
-
producerQueue
protected Queue producerQueue
-
consumerSession
protected QueueSession consumerSession
-
producerSession
protected QueueSession producerSession
-
selector
protected String selector
-
producer
protected QueueSender producer
-
consumerConnection
protected QueueConnection consumerConnection
-
producerConnection
protected QueueConnection producerConnection
-
-
Constructor Detail
-
OutboundQueueBridge
public OutboundQueueBridge(String outboundQueueName)
Constructor that takes a foreign destination as an argument- Parameters:
outboundQueueName-
-
OutboundQueueBridge
public OutboundQueueBridge()
Default Constructor
-
-
Method Detail
-
getOutboundQueueName
public String getOutboundQueueName()
- Returns:
- Returns the outboundQueueName.
-
setOutboundQueueName
public void setOutboundQueueName(String outboundQueueName)
Sets the name of the outbound queue name. If the inbound queue name has not been set already then this method uses the provided queue name to set the inbound topic name as well.- Parameters:
outboundQueueName- The outboundQueueName to set.
-
getLocalQueueName
public String getLocalQueueName()
- Returns:
- the localQueueName
-
setLocalQueueName
public void setLocalQueueName(String localQueueName)
- Parameters:
localQueueName- the localQueueName to set
-
stop
public void stop() throws Exception- Specified by:
stopin interfaceService- Overrides:
stopin classDestinationBridge- Throws:
Exception
-
createConsumer
protected MessageConsumer createConsumer() throws JMSException
- Specified by:
createConsumerin classDestinationBridge- Throws:
JMSException
-
createProducer
protected MessageProducer createProducer() throws JMSException
- Specified by:
createProducerin classDestinationBridge- Throws:
JMSException
-
sendMessage
protected void sendMessage(Message message) throws JMSException
- Specified by:
sendMessagein classDestinationBridge- Throws:
JMSException
-
getConsumerConnection
public QueueConnection getConsumerConnection()
- Returns:
- Returns the consumerConnection.
-
setConsumerConnection
public void setConsumerConnection(QueueConnection consumerConnection)
- Parameters:
consumerConnection- The consumerConnection to set.
-
getConsumerQueue
public Queue getConsumerQueue()
- Returns:
- Returns the consumerQueue.
-
setConsumerQueue
public void setConsumerQueue(Queue consumerQueue)
- Parameters:
consumerQueue- The consumerQueue to set.
-
getProducerConnection
public QueueConnection getProducerConnection()
- Returns:
- Returns the producerConnection.
-
setProducerConnection
public void setProducerConnection(QueueConnection producerConnection)
- Parameters:
producerConnection- The producerConnection to set.
-
getProducerQueue
public Queue getProducerQueue()
- Returns:
- Returns the producerQueue.
-
setProducerQueue
public void setProducerQueue(Queue producerQueue)
- Parameters:
producerQueue- The producerQueue to set.
-
getSelector
public String getSelector()
- Returns:
- Returns the selector.
-
setSelector
public void setSelector(String selector)
- Parameters:
selector- The selector to set.
-
getConnnectionForConsumer
protected Connection getConnnectionForConsumer()
- Specified by:
getConnnectionForConsumerin classDestinationBridge
-
getConnectionForProducer
protected Connection getConnectionForProducer()
- Specified by:
getConnectionForProducerin classDestinationBridge
-
-