Java Code Examples for javax.jms.Destination#toString()

The following examples show how to use javax.jms.Destination#toString() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JmsMessagePropertyIntercepter.java    From qpid-jms with Apache License 2.0 5 votes vote down vote up
@Override
public Object getProperty(JmsMessage message) throws JMSException {
    Destination dest = message.getFacade().getDestination();
    if (dest == null) {
        return null;
    }
    return dest.toString();
}
 
Example 2
Source File: ProxyConnectionFactory.java    From lemon with Apache License 2.0 5 votes vote down vote up
public void sendMessage(MessageContext messageContext,
        Destination destination, Message message) throws JMSException {
    String destinationName = destination.toString();

    if (destination instanceof Topic) {
        messageHandler.sendMessageToTopic(messageContext, destinationName,
                message);
    } else {
        messageHandler.sendMessageToQueue(messageContext, destinationName,
                message);
    }
}
 
Example 3
Source File: ProxyConnectionFactory.java    From lemon with Apache License 2.0 5 votes vote down vote up
public MessageConsumer createConsumer(Destination destination,
        ProxySession session) throws JMSException {
    String destinationName = destination.toString();
    ProxyMessageConsumer messageConsumer = new ProxyMessageConsumer(session);
    messageConsumer.setDestination(destination);

    if (destination instanceof Topic) {
        this.messageHandler.registerToTopic(destinationName,
                messageConsumer.getId());
    }

    return messageConsumer;
}
 
Example 4
Source File: ProxyConnectionFactory.java    From lemon with Apache License 2.0 5 votes vote down vote up
public void removeMessageConsumer(ProxyMessageConsumer messageConsumer)
        throws JMSException {
    Destination destination = messageConsumer.getDestination();

    if (destination instanceof Topic) {
        String destinationName = destination.toString();
        this.messageHandler.unregisterFromTopic(destinationName,
                messageConsumer.getId());
    }
}
 
Example 5
Source File: ConsumerThread.java    From activemq-artemis with Apache License 2.0 4 votes vote down vote up
public ConsumerThread(Session session, Destination destination, int threadNr) {
   super("Consumer " + destination.toString() + ", thread=" + threadNr);
   this.destination = destination;
   this.session = session;
}
 
Example 6
Source File: ProducerThread.java    From activemq-artemis with Apache License 2.0 4 votes vote down vote up
public ProducerThread(Session session, Destination destination, int threadNr) {
   super("Producer " + destination.toString() + ", thread=" + threadNr);
   this.destination = destination;
   this.session = session;
}
 
Example 7
Source File: JmsMessageTransformationTest.java    From qpid-jms with Apache License 2.0 4 votes vote down vote up
@Override
public JmsDestination transform(Destination destination) throws JMSException {
    return new JmsQueue(destination.toString());
}