Class OutboundTopicBridge

java.lang.Object
org.apache.activemq.network.jms.DestinationBridge
org.apache.activemq.network.jms.OutboundTopicBridge
All Implemented Interfaces:
jakarta.jms.MessageListener, org.apache.activemq.Service

public class OutboundTopicBridge extends DestinationBridge
Create an Outbound Topic Bridge. By default the bridge uses the same name for both the inbound and outbound topics, however this can be altered by using the public setter methods to configure both inbound and outbound topic names.
  • 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

      protected String consumerName
    • selector

      protected String selector
    • producer

      protected jakarta.jms.TopicPublisher producer
    • consumerConnection

      protected jakarta.jms.TopicConnection consumerConnection
    • producerConnection

      protected jakarta.jms.TopicConnection producerConnection
  • Constructor Details

    • OutboundTopicBridge

      public OutboundTopicBridge(String outboundTopicName)
      Constructor that takes a foreign destination as an argument
      Parameters:
      outboundTopicName -
    • OutboundTopicBridge

      public OutboundTopicBridge()
      Default Contructor
  • Method Details

    • getOutboundTopicName

      public String getOutboundTopicName()
      Returns:
      Returns the outboundTopicName.
    • setOutboundTopicName

      public void setOutboundTopicName(String outboundTopicName)
      Sets the name of the outbound topic name. If the inbound topic name has not been set already then this method uses the provided topic name to set the inbound topic name as well.
      Parameters:
      outboundTopicName - The outboundTopicName to set.
    • getLocalTopicName

      public String getLocalTopicName()
      Returns:
      the localTopicName
    • setLocalTopicName

      public void setLocalTopicName(String localTopicName)
      Parameters:
      localTopicName - the localTopicName to set
    • stop

      public void stop() throws Exception
      Specified by:
      stop in interface org.apache.activemq.Service
      Overrides:
      stop in class DestinationBridge
      Throws:
      Exception
    • createConsumer

      protected jakarta.jms.MessageConsumer createConsumer() throws jakarta.jms.JMSException
      Specified by:
      createConsumer in class DestinationBridge
      Throws:
      jakarta.jms.JMSException
    • createProducer

      protected jakarta.jms.MessageProducer createProducer() throws jakarta.jms.JMSException
      Specified by:
      createProducer in class DestinationBridge
      Throws:
      jakarta.jms.JMSException
    • sendMessage

      protected void sendMessage(jakarta.jms.Message message) throws jakarta.jms.JMSException
      Specified by:
      sendMessage in class DestinationBridge
      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

      public String getConsumerName()
      Returns:
      Returns the consumerName.
    • setConsumerName

      public void setConsumerName(String consumerName)
      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

      public String getSelector()
      Returns:
      Returns the selector.
    • setSelector

      public void setSelector(String selector)
      Parameters:
      selector - The selector to set.
    • getConnnectionForConsumer

      protected jakarta.jms.Connection getConnnectionForConsumer()
      Specified by:
      getConnnectionForConsumer in class DestinationBridge
    • getConnectionForProducer

      protected jakarta.jms.Connection getConnectionForProducer()
      Specified by:
      getConnectionForProducer in class DestinationBridge