@Override public void start() throws Exception { if (started.compareAndSet(false, true)) { createConsumer(); createProducer(); } }
Destination replyTo = message.getJMSReplyTo(); if (replyTo != null) { converted = jmsMessageConvertor.convert(message, processReplyToDestination(replyTo)); } else { converted = jmsMessageConvertor.convert(message); sendMessage(converted); } catch(Exception e) { jmsConnector.handleConnectionFailure(getConnectionForProducer()); continue; message.acknowledge(); } catch(Exception e) { jmsConnector.handleConnectionFailure(getConnnectionForConsumer()); continue;
protected Destination processReplyToDestination(Destination destination) { return jmsConnector.createReplyToBridge(destination, getConnnectionForConsumer(), getConnectionForProducer()); }
@Override public void stop() throws Exception { if (started.compareAndSet(true, false)) { ThreadPoolUtils.shutdown(connectionService); connectionService = null; if (foreignConnection.get() != null) { try { foreignConnection.get().close(); } catch (Exception e) { } } if (localConnection.get() != null) { try { localConnection.get().close(); } catch (Exception e) { } } for (DestinationBridge bridge : inboundBridges) { bridge.stop(); } for (DestinationBridge bridge : outboundBridges) { bridge.stop(); } LOG.info("JMS Connector {} stopped", getName()); } }
restartProducer(); Destination replyTo = message.getJMSReplyTo(); if (replyTo != null) { converted = jmsMessageConvertor.convert(message, processReplyToDestination(replyTo)); } else { converted = jmsMessageConvertor.convert(message); converted = jmsMessageConvertor.convert(message); sendMessage(converted); message.acknowledge(); return; if (maximumRetries > 0 && attempt >= maximumRetries) { try { stop(); } catch (Exception e1) { LOG.warn("Failed to stop cleanly", e1);
protected void restartProducer() throws JMSException, NamingException { try { //don't reconnect immediately Thread.sleep(1000); getConnectionForProducer().close(); } catch (Exception e) { LOG.debug("Ignoring failure to close producer connection: " + e, e); } jmsConnector.restartProducerConnection(); createProducer(); } }
@Override protected boolean removeEldestEntry(Map.Entry<Destination, DestinationBridge> enty) { if (size() > maxCacheSize) { Iterator<Map.Entry<Destination, DestinationBridge>> iter = entrySet().iterator(); Map.Entry<Destination, DestinationBridge> lru = iter.next(); remove(lru.getKey()); DestinationBridge bridge = lru.getValue(); try { bridge.stop(); LOG.info("Expired bridge: {}", bridge); } catch (Exception e) { LOG.warn("Stopping expired bridge {} caused an exception", bridge, e); } } return false; } };
protected Destination processReplyToDestination(Destination destination) { return jmsConnector.createReplyToBridge(destination, getConnnectionForConsumer(), getConnectionForProducer()); }
Destination replyTo = message.getJMSReplyTo(); if (replyTo != null) { converted = jmsMessageConvertor.convert(message, processReplyToDestination(replyTo)); } else { converted = jmsMessageConvertor.convert(message); sendMessage(converted); } catch(Exception e) { jmsConnector.handleConnectionFailure(getConnectionForProducer()); continue; message.acknowledge(); } catch(Exception e) { jmsConnector.handleConnectionFailure(getConnnectionForConsumer()); continue;
public void stop() throws Exception { super.stop(); if (consumerSession != null) { consumerSession.close(); } if (producerSession != null) { producerSession.close(); } }
@Override public void start() throws Exception { if (started.compareAndSet(false, true)) { createConsumer(); createProducer(); } }
protected Destination processReplyToDestination(Destination destination) { return jmsConnector.createReplyToBridge(destination, getConnnectionForConsumer(), getConnectionForProducer()); }
Destination replyTo = message.getJMSReplyTo(); if (replyTo != null) { converted = jmsMessageConvertor.convert(message, processReplyToDestination(replyTo)); } else { converted = jmsMessageConvertor.convert(message); sendMessage(converted); } catch(Exception e) { jmsConnector.handleConnectionFailure(getConnectionForProducer()); continue; message.acknowledge(); } catch(Exception e) { jmsConnector.handleConnectionFailure(getConnnectionForConsumer()); continue;
@Override public void stop() throws Exception { super.stop(); if (consumerSession != null) { consumerSession.close(); } if (producerSession != null) { producerSession.close(); } }
@Override public void start() throws Exception { if (started.compareAndSet(false, true)) { createConsumer(); createProducer(); } }
protected Destination processReplyToDestination(Destination destination) { return jmsConnector.createReplyToBridge(destination, getConnnectionForConsumer(), getConnectionForProducer()); }
Destination replyTo = message.getJMSReplyTo(); if (replyTo != null) { converted = jmsMessageConvertor.convert(message, processReplyToDestination(replyTo)); } else { converted = jmsMessageConvertor.convert(message); sendMessage(converted); } catch(Exception e) { jmsConnector.handleConnectionFailure(getConnectionForProducer()); continue; message.acknowledge(); } catch(Exception e) { jmsConnector.handleConnectionFailure(getConnnectionForConsumer()); continue;