- 5 minutes to read

Implement the Custom Connector

This page takes you from download to verified logging with the Nodinite 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.

  • ✅ 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:

Step 1: Download the Custom Connector

  1. Log in to the Nodinite portal
  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
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
Select "Packaged mule application (.jar)" from the import wizard.

Import JAR file dialog with the JAR location and project name
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 - 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
A reusable logging subflow with Create Log Event and destination components.

Example subflow configuration (ActiveMQ destination)

<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
  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
A Mule ESB flow using the Nodinite Custom Connector at the receive, before processing, and after processing steps.

<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.

Step 5: Configure the Pickup Service

The Pickup Log Events Service Logging Agent 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 Nodinite Web Client
  2. Review log quality:

  3. Fine-tune performance:

    • Adjust destination batch sizes
    • Optimize Pickup Service intervals
    • Monitor destination queue/table depths

Next Steps

Log Event Content
Complete Working Example
Pickup Log Events Service
Add or manage Search Fields

Custom Connector for Mule ESB Logging
Asynchronous Logging
Log API
JSON Log Event
Message Types
Search Fields
Log Status Codes