protected void createMessageListener(JmsEndpoint endpoint, Processor processor) { messageListener = new EndpointMessageListener(endpoint, processor); getEndpoint().getConfiguration().configureMessageListener(messageListener); messageListener.setBinding(endpoint.getBinding()); messageListener.setAsync(endpoint.getConfiguration().isAsyncConsumer()); }
public Message createMessage(Session session) throws JMSException { Message reply = endpoint.getBinding().makeJmsMessage(exchange, out, session, cause); final String correlationID = determineCorrelationId(message); reply.setJMSCorrelationID(correlationID); if (LOG.isDebugEnabled()) { LOG.debug("{} sending reply JMS message [correlationId:{}]: {}", endpoint, correlationID, reply); } return reply; } });
protected Object getReplyToDestination(Message message) throws JMSException { // lets send a response back if we can Object destination = getReplyToDestination(); if (destination == null) { destination = JmsMessageHelper.getJMSReplyTo(message); } return destination; }
public void configureMessageListener(EndpointMessageListener listener) { if (isDisableReplyTo()) { listener.setDisableReplyTo(true); } if (isEagerLoadingOfProperties()) { listener.setEagerLoadingOfProperties(true); } if (getReplyTo() != null) { listener.setReplyToDestination(getReplyTo()); } JmsOperations operations = listener.getTemplate(); if (operations instanceof JmsTemplate) { JmsTemplate template = (JmsTemplate) operations; template.setDeliveryPersistent(isReplyToDeliveryPersistent()); } }
RuntimeCamelException rce; try { Object replyDestination = getReplyToDestination(message); final Exchange exchange = createExchange(message, session, replyDestination); if (eagerLoadingOfProperties) { exchange.getIn().getBody(); if (forceSync || !isAsync()) {
protected void sendReply(Destination replyDestination, final Message message, final Exchange exchange, final org.apache.camel.Message out, final Exception cause) { if (replyDestination == null) { LOG.debug("Cannot send reply message as there is no replyDestination for: {}", out); return; } getTemplate().send(replyDestination, new MessageCreator() { public Message createMessage(Session session) throws JMSException { Message reply = endpoint.getBinding().makeJmsMessage(exchange, out, session, cause); final String correlationID = determineCorrelationId(message); reply.setJMSCorrelationID(correlationID); if (LOG.isDebugEnabled()) { LOG.debug("{} sending reply JMS message [correlationId:{}]: {}", endpoint, correlationID, reply); } return reply; } }); }
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; }
protected void sendReply(String replyDestination, final Message message, final Exchange exchange, final org.apache.camel.Message out, final Exception cause) { if (replyDestination == null) { LOG.debug("Cannot send reply message as there is no replyDestination for: {}", out); return; } getTemplate().send(replyDestination, new MessageCreator() { public Message createMessage(Session session) throws JMSException { Message reply = endpoint.getBinding().makeJmsMessage(exchange, out, session, cause); final String correlationID = determineCorrelationId(message); reply.setJMSCorrelationID(correlationID); if (LOG.isDebugEnabled()) { LOG.debug("{} sending reply JMS message [correlationId:{}]: {}", endpoint, correlationID, reply); } return reply; } }); }
public Message createMessage(Session session) throws JMSException { Message reply = endpoint.getBinding().makeJmsMessage(exchange, out, session, cause); final String correlationID = determineCorrelationId(message); reply.setJMSCorrelationID(correlationID); if (LOG.isDebugEnabled()) { LOG.debug("{} sending reply JMS message [correlationId:{}]: {}", endpoint, correlationID, reply); } return reply; } });