You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Claus Ibsen (Jira)" <ji...@apache.org> on 2021/05/07 12:34:00 UTC

[jira] [Resolved] (CAMEL-16586) camel-aws2-sns: messages for different endpoints are published to the same topic

     [ https://issues.apache.org/jira/browse/CAMEL-16586?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Claus Ibsen resolved CAMEL-16586.
---------------------------------
    Resolution: Fixed

> 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)