Package org.apache.activemq.network.jms
Class InboundTopicBridge
java.lang.Object
org.apache.activemq.network.jms.DestinationBridge
org.apache.activemq.network.jms.InboundTopicBridge
- All Implemented Interfaces:
jakarta.jms.MessageListener,org.apache.activemq.Service
Create an Inbound Topic Bridge. By default this class uses the topic name for
both the inbound and outbound topic. This behavior can be overridden however
by using the setter methods to configure both the inbound and outboud topic names
separately.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected jakarta.jms.TopicConnectionprotected Stringprotected jakarta.jms.TopicSessionprotected jakarta.jms.Topicprotected jakarta.jms.TopicPublisherprotected jakarta.jms.TopicConnectionprotected jakarta.jms.TopicSessionprotected jakarta.jms.Topicprotected StringFields inherited from class org.apache.activemq.network.jms.DestinationBridge
consumer, doHandleReplyTo, jmsConnector, jmsMessageConvertor, started -
Constructor Summary
ConstructorsConstructorDescriptionDefault ConstructorInboundTopicBridge(String inboundTopicName) Constructor that takes a foreign destination as an argument -
Method Summary
Modifier and TypeMethodDescriptionprotected jakarta.jms.MessageConsumerprotected jakarta.jms.MessageProducerprotected jakarta.jms.Connectionprotected jakarta.jms.Connectionjakarta.jms.TopicConnectionjakarta.jms.Topicjakarta.jms.TopicConnectionjakarta.jms.Topicprotected voidsendMessage(jakarta.jms.Message message) voidsetConsumerConnection(jakarta.jms.TopicConnection consumerConnection) voidsetConsumerName(String consumerName) voidsetConsumerTopic(jakarta.jms.Topic consumerTopic) voidsetInboundTopicName(String inboundTopicName) Sets the topic name used for the inbound topic, if the outbound topic name has not been set, then this method uses the same name to configure the outbound topic name.voidsetLocalTopicName(String localTopicName) voidsetProducerConnection(jakarta.jms.TopicConnection producerConnection) voidsetProducerTopic(jakarta.jms.Topic producerTopic) 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 Details
-
consumerTopic
protected jakarta.jms.Topic consumerTopic -
producerTopic
protected jakarta.jms.Topic producerTopic -
consumerSession
protected jakarta.jms.TopicSession consumerSession -
producerSession
protected jakarta.jms.TopicSession producerSession -
consumerName
-
selector
-
producer
protected jakarta.jms.TopicPublisher producer -
consumerConnection
protected jakarta.jms.TopicConnection consumerConnection -
producerConnection
protected jakarta.jms.TopicConnection producerConnection
-
-
Constructor Details
-
InboundTopicBridge
Constructor that takes a foreign destination as an argument- Parameters:
inboundTopicName-
-
InboundTopicBridge
public InboundTopicBridge()Default Constructor
-
-
Method Details
-
getInboundTopicName
- Returns:
- Returns the outboundTopicName.
-
setInboundTopicName
Sets the topic name used for the inbound topic, if the outbound topic name has not been set, then this method uses the same name to configure the outbound topic name.- Parameters:
inboundTopicName-
-
getLocalTopicName
- Returns:
- the localTopicName
-
setLocalTopicName
- Parameters:
localTopicName- the localTopicName to set
-
stop
- Specified by:
stopin interfaceorg.apache.activemq.Service- Overrides:
stopin classDestinationBridge- Throws:
Exception
-
createConsumer
protected jakarta.jms.MessageConsumer createConsumer() throws jakarta.jms.JMSException- Specified by:
createConsumerin classDestinationBridge- Throws:
jakarta.jms.JMSException
-
createProducer
protected jakarta.jms.MessageProducer createProducer() throws jakarta.jms.JMSException- Specified by:
createProducerin classDestinationBridge- Throws:
jakarta.jms.JMSException
-
sendMessage
protected void sendMessage(jakarta.jms.Message message) throws jakarta.jms.JMSException - Specified by:
sendMessagein classDestinationBridge- Throws:
jakarta.jms.JMSException
-
getConsumerConnection
public jakarta.jms.TopicConnection getConsumerConnection()- Returns:
- Returns the consumerConnection.
-
setConsumerConnection
public void setConsumerConnection(jakarta.jms.TopicConnection consumerConnection) - Parameters:
consumerConnection- The consumerConnection to set.
-
getConsumerName
- Returns:
- Returns the consumerName.
-
setConsumerName
- Parameters:
consumerName- The consumerName to set.
-
getConsumerTopic
public jakarta.jms.Topic getConsumerTopic()- Returns:
- Returns the consumerTopic.
-
setConsumerTopic
public void setConsumerTopic(jakarta.jms.Topic consumerTopic) - Parameters:
consumerTopic- The consumerTopic to set.
-
getProducerConnection
public jakarta.jms.TopicConnection getProducerConnection()- Returns:
- Returns the producerConnection.
-
setProducerConnection
public void setProducerConnection(jakarta.jms.TopicConnection producerConnection) - Parameters:
producerConnection- The producerConnection to set.
-
getProducerTopic
public jakarta.jms.Topic getProducerTopic()- Returns:
- Returns the producerTopic.
-
setProducerTopic
public void setProducerTopic(jakarta.jms.Topic producerTopic) - Parameters:
producerTopic- The producerTopic to set.
-
getSelector
- Returns:
- Returns the selector.
-
setSelector
- Parameters:
selector- The selector to set.
-
getConnnectionForConsumer
protected jakarta.jms.Connection getConnnectionForConsumer()- Specified by:
getConnnectionForConsumerin classDestinationBridge
-
getConnectionForProducer
protected jakarta.jms.Connection getConnectionForProducer()- Specified by:
getConnectionForProducerin classDestinationBridge
-