Announcement Announcement Module
Collapse
No announcement yet.
Message ID unicity Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Message ID unicity

    Hi !

    I would think that the message id was the same through all the channels. But it seems to change, for example, 4 logs in the same execution of one message :
    Code:
    03d53d2d-8737-46d0-b6e4-0989212f3ef3
    19558c72-a6f5-49fd-beac-0cd502c763e9
    07ed4bd8-8d03-4097-85e3-3d57dcb73c86
    1d08eee6-6b6f-4957-a5cc-f43d4a7bcd1d
    I think I misunderstand something.

    Can you explain to me please.

    Regards.

  • #2
    Hello.

    It depends on your channels' endpoints: in most cases handlers work with payload and they send to the output-channel new Message with processed payload and Map of headers. There are other handlers which works with entire Message, e.g. <bridge>.
    Or you can write your own POJO-MethodInvocation-Handlers for <service-activator>, <transformer> etc., their methods can accept entire Message and return the same message. So, in this case the Message ID won't be changed.

    Hope I'm clear,
    Artem Bilan

    Comment


    • #3
      You are clear
      Thank you.

      I'm trying to create an administration tool. For this I use wire-taps on channels and custom logger service inside custom transformers to register messages in database. Even between 2 wire-taps the ID changes
      So, I need to inject my own identifier inside the header ... to rely all log messages.

      Comment


      • #4
        I need to inject my own identifier inside the header
        Yes, you should.
        However, take a look on correlationId header and in the end you don't to provide your own additional header. Just set value into correlationId via <header-enricher> and in this case it will look as message-flow id.
        But you're free to make your own identifier header.

        Good luck!

        Comment


        • #5
          Thank you again !

          I will use my own identifier for one reason : avoid to modify any framework (future ?) behaviour, not to be intrusive.

          Regards.

          Comment


          • #6
            Just to clarify, Messages are immutable. That is at the core of any Messaging architecture, so Message ID represents the ID of a single Message created and managed by the framework. Its not a business ID or transaction/flow ID. Its an ID of a single Message.
            As Artem stated you can use custom headers or *correlationId* header to accomplish the same ID propagation.
            Also, just want to clarify that eve if your endpoint accepts and returns a Message the Framework will create a new Message using MessageBuilder.fromMessage(), thus resulting in a new Message with new ID.

            Comment

            Working...
            X