---
schema_version: "1"
id: 4d9330fa9d44c95f8fd2154fcb39cd473c3e33af65b8a008f14f2429a6af9cd3
title: Receiving AS2 MDNs
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/as2-connector/6.9/as2-connector-example-receiving-mdn-messages.md
canonical_url: https://docs.mulesoft.com/as2-connector/6.9/as2-connector-example-receiving-mdn-messages
source_site: docs.mulesoft.com
content_type: documentation
content_hash: e7e27742d21a13ea4728624684794c89aa8fc2db0d05ba2846402f8a958b8c6d
description: MuleSoft Documentation Site
release: "6.9"
latest: false
---
---
product: AS2 Connector
version: 6.9
---

# Receiving AS2 MDNs

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

The following example shows how to use Anypoint Connector for AS2 (AS2 Connector) to receive AS2 MDN
(Message Disposition Notification) messages from a trading partner and, for every received MDN, log
a message that contains the message payload to the Studio console.

This example is similar to the
[Receiving AS2 Messages](https://docs.mulesoft.com/as2-connector/6.9/as2-connector-example-receive-send#receiving-messages) example, except that
in this example:

- You use the **AS2 mdn listener** source instead of the **As 2 listener** source and set the path
  to `/receiveMDN`.

- On the **Logger** properties window, you set the **Message** field to `MDN Received: #[payload]`.

The following screenshot shows the Anypoint Studio app flow for this example:

![Receive MDN Messages Example App Flow](/mulesoft/current/en-us/as2-connector/6.9/_images/as2-connector-example-mdn-listener-flow.png)

To test this example:

1.  Run this app.

2.  Run the app configured in the
    [Sending Asynchronous AS2 MDNs](https://docs.mulesoft.com/as2-connector/6.9/as2-connector-example-receive-send#asynchronous-mdns) example.

    In the Studio console in this app, you should see a message for each received AS2 MDN that was
    sent asynchronously. For example:

    ```console
    INFO  2022-09-09 17:15:46,409 [[MuleRuntime].uber.06: [as2-basic-example].ReceiveAsyncMDN.CPU_LITE @1369de96] [processor:
    ReceiveAsyncMDN/processors/0; event: 30609f70-307c-11ed-8f5a-38f9d3713331] org.mule.runtime.core.internal.processor.
    LoggerMessageProcessor: MDN Received!
    ```

> [!NOTE] If the **Receipt delivery url** field is not configured for the **Send with Async MDN**
> source and you are using an HTTP request, the header `Receipt-Delivery-Option` must be included
> with the **As 2 mdn listener** endpoint (`http://localhost:8082/receiveMDN`).

## XML for the Receiving AS2 MDNs Example

Paste this code into your Studio XML editor to quickly load the flow for this example into your Mule
app:

```xml
<?xml version="1.0" encoding="UTF-8"?>
<mule xmlns:http="http://www.mulesoft.org/schema/mule/http"
	xmlns:as2-mule4="http://www.mulesoft.org/schema/mule/as2-mule4" xmlns="http://www.mulesoft.org/schema/mule/core"
	xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/as2-mule4 http://www.mulesoft.org/schema/mule/as2-mule4/current/mule-as2-mule4.xsd">
	<http:listener-config name="HTTP_Listener_config" doc:name="HTTP Listener config" >
		<http:listener-connection host="localhost" port="8082" />
	</http:listener-config>
	<as2-mule4:mdn-listener-config name="AS2_Connector_Mdn_listener_config" doc:name="AS2 Connector Mdn listener config" httpListenerConfig="HTTP_Listener_config" >
		<as2-mule4:self-config as2Name="partnera" x509Alias="partnera" email="support@partnera.com" />
		<as2-mule4:partner-config as2Name="partnerb" x509Alias="partnerb" email="support@partnerb.com" />
		<as2-mule4:key-store-config keystorePassword="test" keystorePath="as2/partnera.p12" privateKeyPassword="test" />
	</as2-mule4:mdn-listener-config>
	<flow name="AS2MDNListener" >
		<as2-mule4:as2-mdn-listener doc:name="As 2 mdn listener"path="/receiveMDN" config-ref="AS2_Connector_Mdn_listener_config"/>
		<logger level="INFO" doc:name="Message Received!" message="MDN Received: #[payload]"/>
	</flow>
</mule>
```

## See Also

- [AS2 Connector Examples](https://docs.mulesoft.com/as2-connector/6.9/as2-connector-examples)

- [Introduction to Anypoint Connectors](https://docs.mulesoft.com/connectors/introduction/introduction-to-anypoint-connectors)

- [Salesforce Help](https://help.salesforce.com)
