---
title: Implement the Mule ESB Custom Connector – Step-by-Step Nodinite Logging Setup
description: "Implement the Nodinite Custom Connector in Mule ESB step by step: download the JAR, add it to Anypoint Studio 6 or 7, create the reusable logging subflow, call it from your flows, configure the Pickup Service, and verify the logging."
---

# Implement the Custom Connector

This page takes you from download to verified logging with the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [Custom Connector][] for Mule ESB. Read the [Custom Connector][] overview first for the architecture and the choice of destination; the field reference is on [Log Event Content][Custom Connector - Log Event Content].

* ✅ One reusable logging subflow for every flow  
* ✅ Works in Anypoint Studio 6 and 7  
* ✅ Asynchronous delivery through the [Pickup Service][]  

## Prerequisites

Before implementing the Custom Connector, ensure you have:

* Mule ESB 3.6, 3.7, 3.8, or 3.9 installed
* Anypoint Studio 6 or 7
* <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [portal][NodinitePortal]<sup><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup> account for connector download
* Destination middleware configured (ActiveMQ, PostgreSQL, or file folder); see [Destination Options][Custom Connector - Destinations]
* [Pickup Log Events Service Logging Agent][Pickup Service] installed and configured
* Understanding of [Asynchronous Logging][] principles

## Step 1: Download the Custom Connector

1. Log in to the <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [portal][NodinitePortal]<sup><i class="fal fa-arrow-up-right-from-square" aria-hidden="true"></i></sup>
2. Navigate to **Downloads** → **Logging Agents** → **Mule ESB Custom Connector**
3. Download the ZIP file containing the JAR package

## Step 2: Add Custom Connector to Anypoint Studio

### For Anypoint Studio 6

1. Extract the ZIP file
2. Copy the JAR file to your Anypoint Studio project's `lib` folder
3. The connector appears in the palette as **Nodinite** (prefix **Log ...**)

![Nodinite Custom Connector in the Anypoint Studio 6 palette][2]  
*The Nodinite Custom Connector installed in the Anypoint Studio 6 palette.*  

### For Anypoint Studio 7

1. Right-click project → **Import** → **Anypoint Studio** → **Packaged mule application (.jar)**
2. Click **Next**
3. Browse to extracted JAR location and select the JAR file
4. Enter a project name
5. Click **Finish**

![Import wizard for Anypoint Studio 7 with Packaged mule application selected][4]  
*Select "Packaged mule application (.jar)" from the import wizard.*  

![Import JAR file dialog with the JAR location and project name][5]  
*Browse to the JAR file location and specify the project name.*  

## Step 3: Create the Logging Subflow

Create a reusable logging subflow that all integration flows will invoke:

1. Create a new subflow named `nodinite-logging-subflow`
2. Add the following components:
   * **Nodinite: Create [Log Event][Log Events]** - formats the [JSON Log Event][]
   * **Destination connector** - posts event to chosen destination (HTTP for [Log API][], JMS for ActiveMQ, etc.)
   * **Set Payload** - restores original payload after logging

![Logging subflow with the Create Log Event and destination components][3]  
*A reusable logging subflow with Create Log Event and destination components.*  

### Example subflow configuration (ActiveMQ destination)

```xml
<sub-flow name="nodinite-logging-subflow">
    <logger message="#[sessionVars.nodiniteLogText]" level="INFO" doc:name="Logger"/>
    <set-variable variableName="payloadBeforeLogging" value="#[payload]" doc:name="Store Payload"/>
    
    <nodinite:create-log-event config-ref="Nodinite__Configuration" 
        endPointName="#[flowVars.endpointName]" 
        endpointUri="#[flowVars.endpointUri]" 
        endPointDirection="#[sessionVars.nodiniteEndPointDirection]" 
        originalMessageTypeName="#[sessionVars.nodiniteMessageTypeName]" 
        logStatus="#[sessionVars.nodiniteLogStatus]" 
        logText="#[sessionVars.nodiniteLogText]" 
        payload="#[payload]" 
        doc:name="Create JSON Log Event">
        <nodinite:context-properties ref="#[sessionVars.nodiniteContextValues]"/>
    </nodinite:create-log-event>
    
    <jms:outbound-endpoint queue="nodinite.log.events" connector-ref="ActiveMQ" doc:name="Post to ActiveMQ"/>
    
    <set-payload value="#[flowVars.payloadBeforeLogging]" doc:name="Restore Payload"/>
</sub-flow>
```

## Step 4: Invoke the Logging Subflow from Integration Flows

Add logging calls at key points in your integration flows:

1. **Before transformation** - log incoming message
2. **After transformation** - log outgoing message
3. **Exception handlers** - log error conditions; see [Exception Handling][Custom Connector - Exceptions]
4. **Conditional branches** - log routing decisions
5. **Subflow entry/exit** - log component boundaries

### Example: File-based integration flow with logging

![Mule ESB flow with logging at receive, before processing, and after processing][1]  
*A Mule ESB flow using the Nodinite Custom Connector at the receive, before processing, and after processing steps.*  

```xml
<flow name="invoice-processing-flow">
    <file:inbound-endpoint path="/drop/invoices" />
    
    <!-- Log: File Received -->
    <scripting:component doc:name="Set Logging Variables">
        <scripting:script engine="Groovy"><![CDATA[
            sessionVars['correlationId'] = message.id;
            sessionVars['nodiniteMessageTypeName'] = "Invoice#1.0";
            sessionVars['nodiniteLogText'] = "File Received";
            sessionVars['nodiniteLogStatus'] = 0;
            sessionVars['nodiniteEndPointDirection'] = 0;
            sessionVars['nodiniteContextValues'] = [
                fileName: flowVars['originalFilename'],
                fileSize: payload.length
            ];
            return payload;
        ]]></scripting:script>
    </scripting:component>
    <flow-ref name="nodinite-logging-subflow" doc:name="Log Receive"/>
    
    <!-- Process message -->
    <transformer ref="invoiceTransformer"/>
    
    <!-- Log: Processing Complete -->
    <scripting:component doc:name="Update Logging Variables">
        <scripting:script engine="Groovy"><![CDATA[
            sessionVars['nodiniteLogText'] = "Processing Complete";
            sessionVars['nodiniteLogStatus'] = 0;
            sessionVars['nodiniteEndPointDirection'] = 1;
            sessionVars['nodiniteContextValues'] = [
                fileName: flowVars['originalFilename'],
                invoiceNumber: flowVars['invoiceNumber'],
                amount: flowVars['invoiceAmount']
            ];
            return payload;
        ]]></scripting:script>
    </scripting:component>
    <flow-ref name="nodinite-logging-subflow" doc:name="Log Success"/>
    
    <file:outbound-endpoint path="/processed/invoices"/>
</flow>
```

For one configuration with all parts together, including the connector and ActiveMQ settings and an exception handler, see the [Complete Working Example][Custom Connector - Complete Example].

## Step 5: Configure the Pickup Service

The [Pickup Log Events Service Logging Agent][Pickup Service] fetches events from your configured destination and forwards them to the [Log API][].

### Configuration steps

1. Install the Pickup Service on a server with access to your destination middleware
2. Configure the pickup source (ActiveMQ queue, PostgreSQL table, or file folder)
3. Configure the Log API target endpoint
4. Set the pickup interval (recommend 30-60 seconds for production)
5. Configure retry and error handling policies

See the [Asynchronous Logging][] and [Pickup Service][] documentation for detailed configuration examples.

## Step 6: Verify Logging and Fine-Tune

1. **Deploy and test:**
   * Deploy your updated Mule flows
   * Trigger a test message
   * Verify event appears in <span class="nodinite-product-name" title="The node that unites different systems. Or as we call it Nodinite">Nodinite</span> [Web Client][]

2. **Review log quality:**
   * Check that [Message Types][] are correctly set
   * Verify [Search Fields][] extract expected values
   * Confirm [Log Status Codes][] reflect business outcomes

3. **Fine-tune performance:**
   * Adjust destination batch sizes
   * Optimize Pickup Service intervals
   * Monitor destination queue/table depths

## <i class="fal fa-hand-point-right" aria-hidden="true"></i> Next Steps

<i class="fal fa-file-code" aria-hidden="true"></i> [Log Event Content][Custom Connector - Log Event Content]  
<i class="fal fa-code" aria-hidden="true"></i> [Complete Working Example][Custom Connector - Complete Example]  
<i class="fal fa-truck-pickup" aria-hidden="true"></i> [Pickup Log Events Service][Pickup Service]  
<i class="fal fa-magnifying-glass-plus" aria-hidden="true"></i> [Add or manage Search Fields][Add or manage Search Field]  

## <i class="fal fa-link-horizontal" aria-hidden="true"></i> Related Topics

<i class="fal fa-puzzle-piece" aria-hidden="true"></i> [Custom Connector for Mule ESB Logging][Custom Connector]  
<i class="fal fa-cloud-arrow-down" aria-hidden="true"></i> [Asynchronous Logging][]  
<i class="fal fa-cloud-arrow-down" aria-hidden="true"></i> [Log API][]  
<i class="fal fa-code" aria-hidden="true"></i> [JSON Log Event][]  
<i class="fal fa-file" aria-hidden="true"></i> [Message Types][]  
<i class="fal fa-magnifying-glass-plus" aria-hidden="true"></i> [Search Fields][]  
<i class="fal fa-key" aria-hidden="true"></i> [Log Status Codes][]  

[1]:https://docs.nodinite.com/media/Documentation%20Pictures/LogAgent/Mule/CustomConnector/ExampleFlow.png
[2]:https://docs.nodinite.com/media/Documentation%20Pictures/LogAgent/Mule/CustomConnector/NodiniteConnector.png
[3]:https://docs.nodinite.com/media/Documentation%20Pictures/LogAgent/Mule/CustomConnector/SubFlowLogging.png
[4]:https://docs.nodinite.com/media/Documentation%20Pictures/LogAgent/Mule/ImportWizard.png
[5]:https://docs.nodinite.com/media/Documentation%20Pictures/LogAgent/Mule/ImportProjectModule.png

[Add or manage Search Field]:https://docs.nodinite.com/administration/log-management/search-fields/features/add-or-manage-search-field/
[Asynchronous Logging]:https://docs.nodinite.com/core-services/log-api/features/asynchronous-logging/
[Custom Connector]:https://docs.nodinite.com/logging-and-monitoring/mulesoft-anypoint-platform-logging/features/custom-connector/
[Custom Connector - Complete Example]:https://docs.nodinite.com/logging-and-monitoring/mulesoft-anypoint-platform-logging/features/custom-connector-complete-example/
[Custom Connector - Destinations]:https://docs.nodinite.com/logging-and-monitoring/mulesoft-anypoint-platform-logging/features/custom-connector/#destination-options
[Custom Connector - Exceptions]:https://docs.nodinite.com/logging-and-monitoring/mulesoft-anypoint-platform-logging/features/custom-connector-log-event-content/#exception-handling-and-error-logging
[Custom Connector - Log Event Content]:https://docs.nodinite.com/logging-and-monitoring/mulesoft-anypoint-platform-logging/features/custom-connector-log-event-content/
[JSON Log Event]:https://docs.nodinite.com/core-services/log-event/features/json-log-event/
[Log API]:https://docs.nodinite.com/core-services/log-api/overview/
[Log Events]:https://docs.nodinite.com/core-services/log-event/overview/
[Log Status Codes]:https://docs.nodinite.com/administration/log-management/log-agents/features/what-is-a-log-status-code/
[Message Types]:https://docs.nodinite.com/repository-model/message-types/overview/
[NodinitePortal]:https://portal.nodinite.com
[Pickup Service]:https://docs.nodinite.com/logging-and-monitoring/pickup-logevents-service/overview/
[Search Fields]:https://docs.nodinite.com/administration/log-management/search-fields/features/what-is-a-search-field/
[Web Client]:https://docs.nodinite.com/getting-started/overview/