protected MessagingException convertJmsException(JmsException ex) { if (ex instanceof org.springframework.jms.support.destination.DestinationResolutionException || ex instanceof InvalidDestinationException) { return new DestinationResolutionException(ex.getMessage(), ex); } if (ex instanceof org.springframework.jms.support.converter.MessageConversionException) { return new MessageConversionException(ex.getMessage(), ex); } // Fallback return new MessagingException(ex.getMessage(), ex); }
protected MessagingException convertJmsException(JmsException ex) { if (ex instanceof org.springframework.jms.support.destination.DestinationResolutionException || ex instanceof InvalidDestinationException) { return new DestinationResolutionException(ex.getMessage(), ex); } if (ex instanceof org.springframework.jms.support.converter.MessageConversionException) { return new MessageConversionException(ex.getMessage(), ex); } // Fallback return new MessagingException(ex.getMessage(), ex); }
@Override protected void doStart() { if (!listenerContainer.isRunning()) { try { listenerContainer.start(); } catch (JmsException ex) { LOG.error("Error starting message listener container: " + ex.getMessage(), ex); throw ex; } LOG.info("Started"); } }
@Override protected void doStop() { if (listenerContainer.isRunning()) { try { listenerContainer.stop(); } catch (JmsException ex) { LOG.error("Error stopping message listener container: " + ex.getMessage(), ex); throw ex; } LOG.info("Stopped"); } }
protected void doStop() { // stop all listener containers for (Entry<BridgedDestination, AbstractMessageListenerContainer> entry : listenerMap.entrySet()) { final BridgedDestination destination = entry.getKey(); final AbstractMessageListenerContainer listener = entry.getValue(); if (listener.isRunning()) { try { if (LOG.isDebugEnabled()) { LOG.debug("Stopping listener for " + destination); } listener.stop(); if (LOG.isDebugEnabled()) { LOG.debug("Listener stopped for " + destination); } } catch (JmsException e) { LOG.error("Error stopping connector for listener " + listener + ": " + e.getMessage(), e); } } } LOG.info("Stopped"); }
protected void doStart() { JmsException failedException = null; // start all the listener containers for (Entry<BridgedDestination, AbstractMessageListenerContainer> entry : listenerMap.entrySet()) { final BridgedDestination destination = entry.getKey(); final AbstractMessageListenerContainer listener = entry.getValue(); if (!listener.isRunning()) { try { if (LOG.isDebugEnabled()) { LOG.debug("Starting listener for " + destination); } listener.start(); if (LOG.isDebugEnabled()) { LOG.debug("Listener started for " + destination); } } catch (JmsException e) { failedException = e; LOG.error("Error stopping connector for listener " + listener + ": " + e.getMessage(), e); break; } } } if (failedException != null) { // stop all listeners stop(); throw failedException; } LOG.info("Started"); }
+ destination.getName() + " : " + e.getMessage(), e);
@Override protected void doDestroy() { if (listenerContainer.isActive()) { try { listenerContainer.destroy(); } catch (JmsException ex) { LOG.error("Error destroying message listener container: " + ex.getMessage(), ex); throw ex; } } // check if we created pooled connection factories if (localBrokerConfig.getConnectionFactory() == null && localConnectionFactory != null) { ((PooledConnectionFactory)localConnectionFactory).stop(); } if (remoteBrokerConfig != null && remoteBrokerConfig.getConnectionFactory() == null && remoteConnectionFactory != null) { ((PooledConnectionFactory)remoteConnectionFactory).stop(); } LOG.info("Destroyed"); }