@Test public void parseMessageHeaderIntoBackend() throws Exception { final Map<String, LongString> rabbitTraceeHeader = new HashMap<>(); rabbitTraceeHeader.put(INVOCATION_ID_KEY, new TestLongString("Crazy ID")); unit.toMessageProperties(createRabbitHeaderWith(TPIC_HEADER, rabbitTraceeHeader), mock(Envelope.class), CHARSET_UTF8); assertThat(backend.copyToMap(), hasEntry(INVOCATION_ID_KEY, "Crazy ID")); }
@Override public MessageProperties toMessageProperties(AMQP.BasicProperties source, Envelope envelope, String charset) { final MessageProperties messageProperties = super.toMessageProperties(source, envelope, charset); final TraceeFilterConfiguration filterConfiguration = backend.getConfiguration(profile); if (filterConfiguration.shouldProcessContext(AsyncProcess)) { final Map<String, String> traceeContextMap = transformToTraceeContextMap( (Map<String, ?>) messageProperties.getHeaders().get(TPIC_HEADER)); if (traceeContextMap != null && !traceeContextMap.isEmpty()) { backend.putAll(filterConfiguration.filterDeniedParams(traceeContextMap, AsyncProcess)); } } Utilities.generateInvocationIdIfNecessary(backend); return messageProperties; }
TraceeMessagePropertiesConverter extends DefaultMessagePropertiesConverter { @Override public MessageProperties toMessageProperties(AMQP.BasicProperties source, Envelope envelope, String charset) { final MessageProperties messageProperties = super.toMessageProperties(source, envelope, charset); final TraceeFilterConfiguration filterConfiguration = backend.getConfiguration(profile); if (filterConfiguration.shouldProcessContext(AsyncProcess)) { final Map<String, String> traceeContextMap = transformToTraceeContextMap( (Map<String, ?>) messageProperties.getHeaders().get(TPIC_HEADER)); if (traceeContextMap != null && !traceeContextMap.isEmpty()) { backend.putAll(filterConfiguration.filterDeniedParams(traceeContextMap, AsyncProcess)); } } Utilities.generateInvocationIdIfNecessary(backend); return messageProperties; } }
TraceeMessagePropertiesConverter extends DefaultMessagePropertiesConverter { @Override public MessageProperties toMessageProperties(AMQP.BasicProperties source, Envelope envelope, String charset) { final MessageProperties messageProperties = super.toMessageProperties(source, envelope, charset); final TraceeFilterConfiguration filterConfiguration = backend.getConfiguration(profile); if (filterConfiguration.shouldProcessContext(AsyncProcess)) { final Map<String, String> traceeContextMap = transformToTraceeContextMap( (Map<String, ?>) messageProperties.getHeaders().get(TPIC_HEADER)); if (traceeContextMap != null && !traceeContextMap.isEmpty()) { backend.putAll(filterConfiguration.filterDeniedParams(traceeContextMap, AsyncProcess)); } } Utilities.generateInvocationIdIfNecessary(backend); return messageProperties; } TraceeMessagePropertiesConverter();  TraceeMessagePropertiesConverter(String profile);   TraceeMessagePropertiesConverter(TraceeBackend backend, String profile); }
TraceeMessagePropertiesConverter extends DefaultMessagePropertiesConverter { @Override public MessageProperties toMessageProperties(AMQP.BasicProperties source, Envelope envelope, String charset) { final MessageProperties messageProperties = super.toMessageProperties(source, envelope, charset); final TraceeFilterConfiguration filterConfiguration = backend.getConfiguration(profile); if (filterConfiguration.shouldProcessContext(AsyncProcess)) { final Map<String, String> traceeContextMap = transformToTraceeContextMap( (Map<String, ?>) messageProperties.getHeaders().get(TPIC_HEADER)); if (traceeContextMap != null && !traceeContextMap.isEmpty()) { backend.putAll(filterConfiguration.filterDeniedParams(traceeContextMap, AsyncProcess)); } } Utilities.generateInvocationIdIfNecessary(backend); return messageProperties; } TraceeMessagePropertiesConverter();  TraceeMessagePropertiesConverter(String profile);   TraceeMessagePropertiesConverter(TraceeBackend backend, String profile); @Override MessageProperties toMessageProperties(AMQP.BasicProperties source, Envelope envelope, String charset); @Override AMQP.BasicProperties fromMessageProperties(MessageProperties source, String charset); }
TraceeMessagePropertiesConverter extends DefaultMessagePropertiesConverter { @Override public MessageProperties toMessageProperties(AMQP.BasicProperties source, Envelope envelope, String charset) { final MessageProperties messageProperties = super.toMessageProperties(source, envelope, charset); final TraceeFilterConfiguration filterConfiguration = backend.getConfiguration(profile); if (filterConfiguration.shouldProcessContext(AsyncProcess)) { final Map<String, String> traceeContextMap = transformToTraceeContextMap( (Map<String, ?>) messageProperties.getHeaders().get(TPIC_HEADER)); if (traceeContextMap != null && !traceeContextMap.isEmpty()) { backend.putAll(filterConfiguration.filterDeniedParams(traceeContextMap, AsyncProcess)); } } Utilities.generateInvocationIdIfNecessary(backend); return messageProperties; } TraceeMessagePropertiesConverter();  TraceeMessagePropertiesConverter(String profile);   TraceeMessagePropertiesConverter(TraceeBackend backend, String profile); @Override MessageProperties toMessageProperties(AMQP.BasicProperties source, Envelope envelope, String charset); @Override AMQP.BasicProperties fromMessageProperties(MessageProperties source, String charset);  }