none
Stopping message at Pipeline component RRS feed

  • Question

  • Hi all,

    I have a message and I am checking if the file size is more than 4 MB, the files should be  routed back in a email. 

    If it is less than 4 MB, it should be processed further with orchestration.

    Now i have written the code and working fine, I am just not sure if I can return a null pINMsg incase size is more than 4 MB. As of now I thought of constructing a null data message with only namespace and reject it in the orchestration.

    Is there any other way to ignore the 4 MB message in the pipeline ??

    Thanks,

    Varun


    Thanks, Varun

    Tuesday, February 24, 2015 2:38 PM

Answers

  • Hi Varun,

    If you look closer to your requirement, it’s not “stopping” the message if it’s more than 4MB. It’s actually

    If the message size is greater than 4 MB, then send email with received file as attachment

    Else send/process the message in an Orchestration.

    For this requirement, you can do the following:

    • Create a custom pipeline component use it in Receive Location. In the component check the size of the received message as you do now. If it’s lesser than 4 MB proceed with it by publishing the message to message Box where your Orchestration will subscribe the published message.
    • Again in the same custom receive pipeline component, If the message size is greater than 4 MB, then store the received message to a local drive’s (or shared drive) folder. Don’t publish the >4MB message, but construct a trigger-like message which contains the path where the received file is saved. Publish this trigger-like message into message Box in the case of <4 MB.
    • Have a send port with filter for message type of the trigger-like message. In the send port, use another custom send pipeline with a pipeline component which will receive the trigger message (which would have been published into msgbox in case of >4MB). Retrieve the URL/path for the saved <4MB file construct an email message and with the >4 MB file from local/shared drive as attachment.

    With this design, your requirement is satisfied also you have not published the >4MB file into BizTalk message box.

    Regards,

    M.R.Ashwin Prabhu


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    • Marked as answer by Angie Xu Tuesday, March 3, 2015 11:12 AM
    Tuesday, February 24, 2015 4:00 PM

All replies

  • You can return Null in place of the Message, but then nothing will be routed anywhere.  The Messaging Agent will silently ignore the message.

    I don't think you can set the Body data part stream to Null, though I have never actually tried.

    You can definitely set the data part to an empty stream.  That will get you the desired behavior.

    Tuesday, February 24, 2015 2:45 PM
    Moderator
  • Hi Varun,

    If you look closer to your requirement, it’s not “stopping” the message if it’s more than 4MB. It’s actually

    If the message size is greater than 4 MB, then send email with received file as attachment

    Else send/process the message in an Orchestration.

    For this requirement, you can do the following:

    • Create a custom pipeline component use it in Receive Location. In the component check the size of the received message as you do now. If it’s lesser than 4 MB proceed with it by publishing the message to message Box where your Orchestration will subscribe the published message.
    • Again in the same custom receive pipeline component, If the message size is greater than 4 MB, then store the received message to a local drive’s (or shared drive) folder. Don’t publish the >4MB message, but construct a trigger-like message which contains the path where the received file is saved. Publish this trigger-like message into message Box in the case of <4 MB.
    • Have a send port with filter for message type of the trigger-like message. In the send port, use another custom send pipeline with a pipeline component which will receive the trigger message (which would have been published into msgbox in case of >4MB). Retrieve the URL/path for the saved <4MB file construct an email message and with the >4 MB file from local/shared drive as attachment.

    With this design, your requirement is satisfied also you have not published the >4MB file into BizTalk message box.

    Regards,

    M.R.Ashwin Prabhu


    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

    • Marked as answer by Angie Xu Tuesday, March 3, 2015 11:12 AM
    Tuesday, February 24, 2015 4:00 PM