Description
Endpoints are created sharing the same mutable Configuration object and the topic name (or ARN) stored in this object is updated each time a new endpoint is created. This results in messages intended for one endpoint being sent to the topic name (or ARN) for the most recently created endpoint.
I think this might be a regression introduced by CAMEL-15840.
Here is an example of a failing unit test for SnsComponentConfigurationTest to demonstrate the problem:
@Test public void createMultipleEndpoints() throws Exception { Sns2Component component = context.getComponent("aws2-sns", Sns2Component.class); Sns2Endpoint endpoint1 = (Sns2Endpoint) component.createEndpoint("aws2-sns://Topic1?accessKey=xxx&secretKey=yyy"); assertEquals("Topic1", endpoint1.getConfiguration().getTopicName()); Sns2Endpoint endpoint2 = (Sns2Endpoint) component.createEndpoint("aws2-sns://Topic2?accessKey=xxx&secretKey=yyy"); assertEquals("Topic2", endpoint2.getConfiguration().getTopicName()); // this now fails because endpoint1 and endpoint2 share the same config assertEquals("Topic1", endpoint1.getConfiguration().getTopicName()); }
Attachments
Issue Links
- is caused by
-
CAMEL-15840 camel-aws2-sns: duplicate copies of configuration objects lead to undefined behavior
- Resolved
- links to