none
Message Inspection or message encoding RRS feed

  • Question

  • It seems i can massage the message in the message inspector? (the inspection interfaces seem to support that). I mean, if i need to change or modify the message as it is going out or coming in before being processed is this a good place to do it, or does it have to be somewhere else? there seems to be a message encoding interface also. 
    what i want to do is to change the message if there is a problem or if it is malformed or whatever so that a comm exception or something due to inability to form a reader gets thrown.
    Sunday, October 11, 2009 6:02 PM

Answers

  • If the incoming message is malformed, then your only choice to intercept it is to use a custom message encoder. For a message interceptor to be invoked, a Message object needs to be created, which cannot happen if the incoming message is malformed (so the encoder will not be able to convert the incoming bytes into a Message object).
    Monday, October 12, 2009 4:39 PM

All replies

  • It's a great 'place' do it. Message inspectors should be used for inspection/modification of incoming/outgoing messages.

    Regards,
    Stipe-Ivan
    Sunday, October 11, 2009 9:58 PM
  • well, i am getting a hit in the  BeforeSendRequest only.

    The breakpoint in the associated AfterReceiveReply does not hit (and i get a CommunicationException^) so this hook does not kick in before the text or binary encoder (as the case may be) tries to format the message? Because i need to get hold of the message the first thing after a reply is obtained and not the last thing.
    Monday, October 12, 2009 4:02 PM
  • If the incoming message is malformed, then your only choice to intercept it is to use a custom message encoder. For a message interceptor to be invoked, a Message object needs to be created, which cannot happen if the incoming message is malformed (so the encoder will not be able to convert the incoming bytes into a Message object).
    Monday, October 12, 2009 4:39 PM