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

Add support for the InOut Message Exchange Pattern to the twitter UserProducer in order to be able to retrieve the unique identifier for the published tweet

    XMLWordPrintableJSON

Details

    • Patch Available
    • Novice

    Description

      We have a requirement in our application to be able to post to Twitter and associate the unique identifier for the published tweet (tweet id) to our application specific entity.

      We are fairly new to Apache Camel and we have not been able to find a way to retrieve the tweet id with the current twitter component implementation (based on Twitter4J). If our current (limited) understanding of Apache Camel is correct, we believe that the way to accomplish this would be by using the InOut message exchange pattern (MEP) on the "twitter://timeline/user" endpoint. Nevertheless AFAIK the current endpoint implementation in UserProducer class only supports the InOnly MEP and discards the response object returned by the Twitter API which contains the published tweet id.

      Adding InOut MEP support to the UserProducer would allow a very convenient Camel route like this one:

      from("direct:tweets")
        ...
        .inOut("twitter://timeline/user")
        .transform().simple("The tweet '${body.text}' was published with the tweet id '${body.id}'")
        ...
      

      The attached patch against the current trunk implements InOut MEP support in the UserProducer class together with two unit tests to exercise the code. We are available to provide patches for other branches and to update the Twitter Camel component documentation.

      Attachments

        Activity

          People

            njiang Willem Jiang
            rafael.cordones Rafael Cordones
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: