protected JmsEndpoint createTopicEndpoint(String uri, JmsComponent component, String subject, JmsConfiguration configuration) { return new JmsEndpoint(uri, component, subject, true, configuration); }
/** * Creates a consumer using the given processor and listener container * * @param processor the processor to use to process the messages * @param listenerContainer the listener container * @return a newly created consumer * @throws Exception if the consumer cannot be created */ public JmsConsumer createConsumer(Processor processor, AbstractMessageListenerContainer listenerContainer) throws Exception { JmsConsumer consumer = new JmsConsumer(this, processor, listenerContainer); configureListenerContainer(listenerContainer, consumer); configureConsumer(consumer); return consumer; }
public JmsBinding getBinding() { if (binding == null) { binding = createBinding(); } return binding; }
public JmsConsumer createConsumer(Processor processor) throws Exception { AbstractMessageListenerContainer listenerContainer = createMessageListenerContainer(); return createConsumer(processor, listenerContainer); }
public Exchange createExchange(Message message, Session session) { Exchange exchange = createExchange(getExchangePattern()); exchange.setIn(new JmsMessage(message, session, getBinding())); return exchange; }
public Exchange receive(long timeout) { setReceiveTimeout(timeout); Message message; // using the selector if (ObjectHelper.isNotEmpty(jmsEndpoint.getSelector())) { message = template.receiveSelected(jmsEndpoint.getSelector()); } else { message = template.receive(); } if (message != null) { return getEndpoint().createExchange(message, null); } return null; }
protected void createMessageListenerContainer() throws Exception { listenerContainer = getEndpoint().createMessageListenerContainer(); getEndpoint().configureListenerContainer(listenerContainer, this); listenerContainer.setMessageListener(getEndpointMessageListener()); }
public JmsOperations getInOnlyTemplate() { if (inOnlyTemplate == null) { inOnlyTemplate = endpoint.createInOnlyTemplate(); } return inOnlyTemplate; }
public JmsOperations getInOutTemplate() { if (inOutTemplate == null) { inOutTemplate = endpoint.createInOutTemplate(); } return inOutTemplate; }
@Override public PollingConsumer createPollingConsumer() throws Exception { JmsPollingConsumer answer = new JmsPollingConsumer(this); configurePollingConsumer(answer); return answer; }
public Exchange createExchange(Message message, Session session, Object replyDestination) { Exchange exchange = endpoint.createExchange(); JmsBinding binding = getBinding(); exchange.setProperty(Exchange.BINDING, binding); exchange.setIn(new JmsMessage(message, session, binding)); // lets set to an InOut if we have some kind of reply-to destination if (replyDestination != null && !disableReplyTo) { // only change pattern if not already out capable if (!exchange.getPattern().isOutCapable()) { exchange.setPattern(ExchangePattern.InOut); } } return exchange; }
public synchronized JmsOperations getTemplate() { if (template == null) { template = endpoint.createInOnlyTemplate(); } return template; }
/** * Returns a new JMS endpoint for the given JMS destination */ public static JmsEndpoint newInstance(Destination destination) throws JMSException { if (destination instanceof TemporaryQueue) { return new JmsTemporaryQueueEndpoint((TemporaryQueue) destination); } else if (destination instanceof TemporaryTopic) { return new JmsTemporaryTopicEndpoint((TemporaryTopic) destination); } else if (destination instanceof Queue) { return new JmsQueueEndpoint((Queue) destination); } else { return new JmsEndpoint((Topic) destination); } }
public JmsPollingConsumer(JmsEndpoint endpoint) { this(endpoint, endpoint.createInOnlyTemplate()); }
protected void addTopic(ActiveMQTopic topic) throws Exception { String topicUri = getTopicUri(topic); ActiveMQComponent jmsComponent = getComponent(); Endpoint endpoint = new JmsEndpoint(topicUri, jmsComponent, topic.getPhysicalName(), true, jmsComponent.getConfiguration()); camelContext.addEndpoint(topicUri, endpoint); }
protected void addTopic(ActiveMQTopic topic) throws Exception { String topicUri = getTopicUri(topic); ActiveMQComponent jmsComponent = getComponent(); Endpoint endpoint = new JmsEndpoint(topicUri, jmsComponent, topic.getPhysicalName(), true, jmsComponent.getConfiguration()); camelContext.addEndpoint(topicUri, endpoint); }