Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-16586

camel-aws2-sns: messages for different endpoints are published to the same topic

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.7.4, 3.9.0
    • Fix Version/s: 3.7.5, 3.10.0
    • Component/s: None
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      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

            Activity

              People

              • Assignee:
                orpiske Otavio Rodolfo Piske
                Reporter:
                bencampion Ben Campion
              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: