public void run() { while (running) { try { DeliveryChannel deliveryChannel = context.getDeliveryChannel(); LOGGER.info("about to do an accept on deliveryChannel: {}", deliveryChannel); MessageExchange messageExchange = deliveryChannel.accept(); LOGGER.info("received me: {}", messageExchange); onMessageExchange(messageExchange); } catch (MessagingException e) { LOGGER.error("Failed to process inbound messages: {}", e.getMessage(), e); } } }
/** * convert a concrete messaging exception to fake messaging exception. * @param e * the concrete messaging exception * @return * the fake messaging exception */ public static MessagingException convertMessagingException( final MessagingException e) { MessagingException me = new MessagingException(e.getMessage()); me.setStackTrace(e.getStackTrace()); return me; }
/** Provides metadata query facility for endpoints registered with the NMR. * This method returns the contents of an XML descriptor as a string. * @param service string representation of service QName * @param endpoint endpoint name * @return XML descriptor as string */ public String getDescriptor(String service, String endpoint) { RegisteredEndpoint re; Document desc; String descStr = null; re = mRegistry.getInternalEndpoint(new QName(service), endpoint); try { desc = queryDescriptor(re); if (desc != null) { descStr = XMLUtil.getInstance().asString(desc); } } catch (javax.jbi.messaging.MessagingException msgEx) { mLog.warning(msgEx.getMessage()); } return descStr; }
/** * Process an active exchange (ie, with status ACTIVE) * * @param exchange */ private void processActiveExchange(final Exchange exchange) { try { validateExchange(exchange); if (exchange.getFault() == null) { this.getService(exchange.getOperation()).process(exchange, exchange.getInMessageContentAsDocument()); } else { exchange.setDoneStatus(); } } catch (final MessagingException e) { final StringBuilder builder = new StringBuilder(); builder.append("[Exchange Id:"); builder.append(exchange.getExchangeId()); builder.append("] - "); builder.append(e.getClass().getSimpleName() + " : " + e.getMessage()); this.getLogger().log(Level.WARNING, builder.toString()); exchange.setError(e); } }
mLog.warning(msgEx.getMessage()); throw msgEx;
this.getLogger().log(Level.WARNING, e.getMessage(), e); exchange.setError(e);
.getOperationName(), false); } catch (MessagingException e) { this.log.warning(e.getMessage());
this.log.debug(e.getMessage());
log.error(e.getMessage(), e);