Package org.apache.activemq.network.jms
Class InboundQueueBridge
- java.lang.Object
-
- org.apache.activemq.network.jms.DestinationBridge
-
- org.apache.activemq.network.jms.InboundQueueBridge
-
- All Implemented Interfaces:
MessageListener
,Service
public class InboundQueueBridge extends DestinationBridge
Create an Inbound Queue Bridge. By default this class uses the sname name for both the inbound and outbound queue. This behavior can be overridden however by using the setter methods to configure both the inbound and outboud queue names separately.
-
-
Field Summary
Fields Modifier and Type Field Description protected QueueConnection
consumerConnection
protected Queue
consumerQueue
protected QueueSession
consumerSession
protected QueueSender
producer
protected QueueConnection
producerConnection
protected Queue
producerQueue
protected QueueSession
producerSession
protected String
selector
-
Fields inherited from class org.apache.activemq.network.jms.DestinationBridge
consumer, doHandleReplyTo, jmsConnector, jmsMessageConvertor, started
-
-
Constructor Summary
Constructors Constructor Description InboundQueueBridge()
Default ConstructorInboundQueueBridge(String inboundQueueName)
Constructor that takes a foreign destination as an argument
-
Method Summary
-
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
-
InboundQueueBridge
public InboundQueueBridge(String inboundQueueName)
Constructor that takes a foreign destination as an argument- Parameters:
inboundQueueName
-
-
InboundQueueBridge
public InboundQueueBridge()
Default Constructor
-
-
Method Detail
-
getInboundQueueName
public String getInboundQueueName()
- Returns:
- Returns the inboundQueueName.
-
setInboundQueueName
public void setInboundQueueName(String inboundQueueName)
Sets the queue name used for the inbound queue, if the outbound queue name has not been set, then this method uses the same name to configure the outbound queue name.- Parameters:
inboundQueueName
- The inboundQueueName 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:
stop
in interfaceService
- Overrides:
stop
in classDestinationBridge
- Throws:
Exception
-
createConsumer
protected MessageConsumer createConsumer() throws JMSException
- Specified by:
createConsumer
in classDestinationBridge
- Throws:
JMSException
-
createProducer
protected MessageProducer createProducer() throws JMSException
- Specified by:
createProducer
in classDestinationBridge
- Throws:
JMSException
-
sendMessage
protected void sendMessage(Message message) throws JMSException
- Specified by:
sendMessage
in 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:
getConnnectionForConsumer
in classDestinationBridge
-
getConnectionForProducer
protected Connection getConnectionForProducer()
- Specified by:
getConnectionForProducer
in classDestinationBridge
-
-