@Override
    protected String getDestination(Exchange exchange, Endpoint endpoint) {
        // when using toD for dynamic destination then extract from header
        String destination = exchange.getMessage().getHeader("CamelJmsDestinationName", String.class);
        if (destination == null) {
            destination = super.getDestination(exchange, endpoint);
        }
        return destination;
    }
@Test
    public void testGetDestination() {
        Exchange exchange = Mockito.mock(Exchange.class);
        Message message = Mockito.mock(Message.class);
        Endpoint endpoint = Mockito.mock(Endpoint.class);

        Mockito.when(exchange.getIn()).thenReturn(message);
        Mockito.when(exchange.getMessage()).thenReturn(message);
        Mockito.when(endpoint.getEndpointUri()).thenReturn("jms:cheese?clientId=123");

        AbstractMessagingSpanDecorator decorator = new JmsSpanDecorator();
        assertEquals("cheese", decorator.getDestination(exchange, endpoint));
    }