[
https://issues.apache.org/jira/browse/CAMEL-16586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17340694#comment-17340694
]
Otavio Rodolfo Piske commented on CAMEL-16586:
----------------------------------------------
I've just confirmed that this problem happens on 3.7.x as well. I will work to
backport this fix.
> camel-aws2-sns: messages for different endpoints are published to the same
> topic
> --------------------------------------------------------------------------------
>
> Key: CAMEL-16586
> URL: https://issues.apache.org/jira/browse/CAMEL-16586
> Project: Camel
> Issue Type: Bug
> Affects Versions: 3.7.4, 3.9.0
> Reporter: Ben Campion
> Assignee: Otavio Rodolfo Piske
> Priority: Major
> Fix For: 3.7.5, 3.10.0
>
>
> 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:
> {code:java}
> @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());
> }
> {code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)