public Destination intercept(final Destination destination) { if (destination.getActiveMQDestination().isQueue()) { if (!destination.getActiveMQDestination().isTemporary() || brokerService.isUseTempMirroredQueues()) { try { final Destination mirrorDestination = getMirrorDestination(destination); if (mirrorDestination != null) { return new DestinationFilter(destination) { public void send(ProducerBrokerExchange context, Message message) throws Exception { message.setDestination(mirrorDestination.getActiveMQDestination()); mirrorDestination.send(context, message); if (isCopyMessage()) { message = message.copy(); } message.setDestination(destination.getActiveMQDestination()); message.setMemoryUsage(null); // set this to null so that it will use the queue memoryUsage instance instead of the topic. super.send(context, message); } }; } } catch (Exception e) { LOG.error("Failed to lookup the mirror destination for: {}", destination, e); } } } return destination; }
public Destination intercept(final Destination destination) { if (destination.getActiveMQDestination().isQueue()) { if (!destination.getActiveMQDestination().isTemporary() || brokerService.isUseTempMirroredQueues()) { try { final Destination mirrorDestination = getMirrorDestination(destination); if (mirrorDestination != null) { return new DestinationFilter(destination) { public void send(ProducerBrokerExchange context, Message message) throws Exception { message.setDestination(mirrorDestination.getActiveMQDestination()); mirrorDestination.send(context, message); if (isCopyMessage()) { message = message.copy(); } message.setDestination(destination.getActiveMQDestination()); message.setMemoryUsage(null); // set this to null so that it will use the queue memoryUsage instance instead of the topic. super.send(context, message); } }; } } catch (Exception e) { LOG.error("Failed to lookup the mirror destination for: {}", destination, e); } } } return destination; }
public Destination intercept(final Destination destination) { if (destination.getActiveMQDestination().isQueue()) { if (!destination.getActiveMQDestination().isTemporary() || brokerService.isUseTempMirroredQueues()) { try { final Destination mirrorDestination = getMirrorDestination(destination); if (mirrorDestination != null) { return new DestinationFilter(destination) { public void send(ProducerBrokerExchange context, Message message) throws Exception { message.setDestination(mirrorDestination.getActiveMQDestination()); mirrorDestination.send(context, message); if (isCopyMessage()) { message = message.copy(); } message.setDestination(destination.getActiveMQDestination()); message.setMemoryUsage(null); // set this to null so that it will use the queue memoryUsage instance instead of the topic. super.send(context, message); } }; } } catch (Exception e) { LOG.error("Failed to lookup the mirror destination for: {}", destination, e); } } } return destination; }
public Destination intercept(final Destination destination) { if (destination.getActiveMQDestination().isQueue()) { if (!destination.getActiveMQDestination().isTemporary() || brokerService.isUseTempMirroredQueues()) { try { final Destination mirrorDestination = getMirrorDestination(destination); if (mirrorDestination != null) { return new DestinationFilter(destination) { public void send(ProducerBrokerExchange context, Message message) throws Exception { message.setDestination(mirrorDestination.getActiveMQDestination()); mirrorDestination.send(context, message); if (isCopyMessage()) { message = message.copy(); } message.setDestination(destination.getActiveMQDestination()); super.send(context, message); } }; } } catch (Exception e) { LOG.error("Failed to lookup the mirror destination for: " + destination + ". Reason: " + e, e); } } } return destination; }
public Destination intercept(final Destination destination) { if (destination.getActiveMQDestination().isQueue()) { if (!destination.getActiveMQDestination().isTemporary() || brokerService.isUseTempMirroredQueues()) { try { final Destination mirrorDestination = getMirrorDestination(destination); if (mirrorDestination != null) { return new DestinationFilter(destination) { public void send(ProducerBrokerExchange context, Message message) throws Exception { message.setDestination(mirrorDestination.getActiveMQDestination()); mirrorDestination.send(context, message); if (isCopyMessage()) { message = message.copy(); } message.setDestination(destination.getActiveMQDestination()); message.setMemoryUsage(null); // set this to null so that it will use the queue memoryUsage instance instead of the topic. super.send(context, message); } }; } } catch (Exception e) { LOG.error("Failed to lookup the mirror destination for: {}", destination, e); } } } return destination; }