none
Transport agent on two CAS+MB servers RRS feed

  • Question

  • Good day.
    I am developing simple transport agent that extracts and saves attachments in messages by criteria and then deletes attachments from message.

    Agent is working fine but I've run into a problem with deployment.

    Our organization have two Exchange 2013 (CU7) servers and each of them hosts both roles (CAS+MB).
    If I deploy TA on each server it conflicts - some attaches is cut on first server, some on second server. As a result some files remains unextracted.

    How I need to deploy TA to process EVERY message that flows through E2013 organization but avoid double processing?

    Thank you.

    Friday, May 15, 2015 1:46 AM

Answers

  • That would come back to your design eg what phase are you trying to catch the message in eg are you trying to capture it when it arrives into you Org, after an Internal user sends a Message (and before its forked). You need to understand how messages are routed in your Org eg a message won't be processed by two servers at once, however if its sent to a Distribution list the message then you will have distribution list expansion and Bifurcation see https://technet.microsoft.com/en-us/library/bb430743%28v=exchg.150%29.aspx which will then affect the message . If you wanted to capture a message that was being sent before any other processing happened then using the OnSubmission phase is the best place. If your processing message for multiple domains where the message is received from a external source you could also be processing then a copy of the same message for recipients with different domains the only way to handle that is de-duplicate it based on the InternetMessageId which should be the same across all message. You should be able to tell from the Message Tracking logs in this case is if you have one message or multiple copies of the same message or if and when expansion is happening on your servers.
    • Marked as answer by MindFreedom Monday, May 25, 2015 7:49 AM
    Tuesday, May 19, 2015 4:08 AM

All replies

  • As a general rule you should deploy a Transport Agent to every Hub server (unless you have edge deployed and you only want to process message going in and out of your organization). To stop messages being processed by the Agent twice you can just add a Header the first time you process the Message and then check for that header each time your agent is called if the header doesn't exist process the Message if it does don't process any further.

    Cheers
    Glen

    Friday, May 15, 2015 5:29 AM
  • Glen, thank you.

    I thought myself about that solution - check if message is processed already.

    I'll try it.
    Friday, May 15, 2015 6:16 AM
  • Good day.
    Some update here.

    Unfortunately an header solution didn't work. I have installed agent on both servers. And according to TA log it processess message almost at the same time.
    Maybe I am wrong with EventHandler or transport service?

    I am using SMTPReceive.OnEndOfData Event to trigger agent.

    Tuesday, May 19, 2015 2:54 AM
  • That would come back to your design eg what phase are you trying to catch the message in eg are you trying to capture it when it arrives into you Org, after an Internal user sends a Message (and before its forked). You need to understand how messages are routed in your Org eg a message won't be processed by two servers at once, however if its sent to a Distribution list the message then you will have distribution list expansion and Bifurcation see https://technet.microsoft.com/en-us/library/bb430743%28v=exchg.150%29.aspx which will then affect the message . If you wanted to capture a message that was being sent before any other processing happened then using the OnSubmission phase is the best place. If your processing message for multiple domains where the message is received from a external source you could also be processing then a copy of the same message for recipients with different domains the only way to handle that is de-duplicate it based on the InternetMessageId which should be the same across all message. You should be able to tell from the Message Tracking logs in this case is if you have one message or multiple copies of the same message or if and when expansion is happening on your servers.
    • Marked as answer by MindFreedom Monday, May 25, 2015 7:49 AM
    Tuesday, May 19, 2015 4:08 AM
  • Good day Glen!

    Eventually I managed to get this agent working.

    As you suggested I have moved transport agent to OnSubscribe event AND also implemented a custom header that marks messages on processing to prevent agent triggerng.

    Thank you again for your advice.

    Monday, May 25, 2015 7:49 AM