@Test public void testJmsCorrelationIdToAdaptrisMessageMetadata_NoValue() throws Exception { EmbeddedActiveMq broker = new EmbeddedActiveMq(); JmsConnection conn = broker.getJmsConnection(); try { broker.start(); start(conn); Session session = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE); AdaptrisMessage adpMsg = AdaptrisMessageFactory.getDefaultInstance().newMessage(TEXT); TextMessage jmsMsg = session.createTextMessage(); MetadataCorrelationIdSource mcs = new MetadataCorrelationIdSource(CORRELATIONID_KEY); mcs.processCorrelationId(jmsMsg, adpMsg); assertFalse(adpMsg.containsKey(CORRELATIONID_KEY)); session.close(); } finally { stop(conn); broker.destroy(); } }
@Override public void processCorrelationId(AdaptrisMessage src, Message dest) throws JMSException { String correlationId = src.getMetadataValue(getMetadataKey()); if (isEmpty(correlationId)) { log.warn("no value for metadata key [{}]", getMetadataKey()); } else { dest.setJMSCorrelationID(correlationId); log.debug("set correlation ID to [{}]", correlationId); } }
MetadataCorrelationIdSource implements CorrelationIdSource { @Override public void processCorrelationId(AdaptrisMessage src, Message dest) throws JMSException { String correlationId = src.getMetadataValue(getMetadataKey()); if (isEmpty(correlationId)) { log.warn("no value for metadata key [{}]", getMetadataKey()); } else { dest.setJMSCorrelationID(correlationId); log.debug("set correlation ID to [{}]", correlationId); } } }
MetadataCorrelationIdSource implements CorrelationIdSource { @Override public void processCorrelationId(AdaptrisMessage src, Message dest) throws JMSException { String correlationId = src.getMetadataValue(getMetadataKey()); if (isEmpty(correlationId)) { log.warn("no value for metadata key [{}]", getMetadataKey()); } else { dest.setJMSCorrelationID(correlationId); log.debug("set correlation ID to [{}]", correlationId); } } MetadataCorrelationIdSource();  MetadataCorrelationIdSource(String key); }
MetadataCorrelationIdSource implements CorrelationIdSource { @Override public void processCorrelationId(AdaptrisMessage src, Message dest) throws JMSException { String correlationId = src.getMetadataValue(getMetadataKey()); if (isEmpty(correlationId)) { log.warn("no value for metadata key [{}]", getMetadataKey()); } else { dest.setJMSCorrelationID(correlationId); log.debug("set correlation ID to [{}]", correlationId); } } MetadataCorrelationIdSource();  MetadataCorrelationIdSource(String key); @Override void processCorrelationId(AdaptrisMessage src, Message dest); @Override void processCorrelationId(Message src, AdaptrisMessage dest); String getMetadataKey(); void setMetadataKey(String s); }
MetadataCorrelationIdSource implements CorrelationIdSource { @Override public void processCorrelationId(AdaptrisMessage src, Message dest) throws JMSException { String correlationId = src.getMetadataValue(getMetadataKey()); if (isEmpty(correlationId)) { log.warn("no value for metadata key [{}]", getMetadataKey()); } else { dest.setJMSCorrelationID(correlationId); log.debug("set correlation ID to [{}]", correlationId); } } MetadataCorrelationIdSource();  MetadataCorrelationIdSource(String key); @Override void processCorrelationId(AdaptrisMessage src, Message dest); @Override void processCorrelationId(Message src, AdaptrisMessage dest); String getMetadataKey(); void setMetadataKey(String s);  }