as2 protocol for b2b integration

AS2 Protocol for Business Data Interchange via HTTP, Part 2

The main idea of the AS2 protocol defined in the RFC 4130 is on how we can exchange structured business data securely using the HTTP transfer protocol. In part one of the AS2 article series, we looked at an overview of the AS2 (Applicability Statement 2) protocol and why it wins over the other B2B protocols. We, the developers of the B2B integration platform AS2Gateway, have been working with AS2 protocol for quite some time now and today in this article we hope to give away some insight on how an AS2 message is composed using S/MIME format with a few lines of Java code.

Without further ado, let’s jump right in. The basic structure of an AS2 message consists of a MIME format inside an HTTP message with a few additional specific AS2 headers. The final structure of the composed AS2 message will be as follows. In this article, we’ll go in a step-by-step manner to create the final encrypted HTTP body starting from a document.

as2 protocol for b2b integration

Continue reading “AS2 Protocol for Business Data Interchange via HTTP, Part 2”

as2 protocol for b2b integration

AS2 Protocol for Business Data Interchange via HTTP – Part 1 – Overview

The Applicability Statement 2 or AS2 specification defines a mechanism for the secure and reliable transfer of structured business data over the Internet.

AS2 Message Payloads

The AS2 protocol itself does not dictate any limits on the payload of an AS2 message. However. typical AS2 payloads are structured business documents such as Invoices, Purchase Orders etc. and thus AS2 systems facilitate the Electronic Data Interchange or EDI. Some of the major sets of EDI standards are:

  • The UN-recommended UN/EDIFACT is the only international standard and is predominant outside of North America.
  • The US standard ANSI ASC X12 (X12) is predominant in North America.
  • The TRADACOMS standard developed by the ANA (Article Numbering Association now known as GS1) is predominant in the UK retail industry.
  • The ODETTE standard used within the European automotive industry

AS2 messages can carry non-EDI payloads such as XML, CSV, Fixed Width, Text, or payloads of other standards or proprietary formats, including any binary files.

Continue reading “AS2 Protocol for Business Data Interchange via HTTP – Part 1 – Overview”

enterprise integration

Processing Elements for Enterprise Integration Needs

In February, AdroitLogic released UltraESB-X, a completely redesigned ESB which is developed by the very same team who developed the UltraESB six years ago. UltraESB-X is developed inline with UltraStudio, a user friendly graphical tool to easily create, manage and test integration flows. In the user’s point of view, UltraESB-X mainly has two new concepts namely connectors and processing elements.

What is a Processing Element?

A processing element is an element which performs a specific processing requirement or business logic on the message. It can be one among a wide range of operations such as filtering using conditional branching, transformation, flow control, scope handling such as a transactional scope and many more. Usually processing elements in the UltraStudio editor are represented by an icon with a  bluish background except for  a few exceptions. One of those exceptions is the scope processing element family which uses a purple background and another set of special flow control processing elements which uses a reddish background.


The structure of a processing element is as shown in the above image. There is an In Port (grey colour) which takes a message in, then depending on the type of processing there can be zero or more Out Ports (light yellow) which gives a processed message out and finally there is the On Exception Port (red) which is used to forward the message in case an exception occurs during the processing logic of the element. UltraESB-X ships with dozens of built-in processing elements which covers a wide range of integration processing requirements and more processing elements are continuously added with each release cycle. Current list of processing elements can be browsed through the developer portal of AdroitLogic here. Apart from the inbuilt processing elements, UltraStudio allows user to write their own custom processing elements as explained in the documentation.

Continue reading “Processing Elements for Enterprise Integration Needs”

UltraESB-X Monitoring with Kibana

We at AdroitLogic recently released UltraESB-X developed on top of the flexible, extensible and lightweight Project-X platform. UltraESB-X comes with a GUI developer tool, UltraStudio, to develop, test and package your integration flows easily. Along with this we released Integration Platform Server (IPS), our PaaS solution to manage the deployment, maintenance and scaling of UltraESB-X clusters. When it comes to these enterprise integration products, one thing you can’t keep away is the requirement for statistics and monitoring. AdroitLogic Integration Platform comes with inbuilt monitoring and statistics support and we are in the process of developing our enterprise level monitoring solution IMonitor for UltraESB-X. Since UltraESB-X publishes metrics to the famous, distributed RESTful search and analytics engine Elasticsearch, we can use the open source visualization tool Kibana for monitoring as well. So today we will go through the steps to setup UltraESB-X monitoring with Kibana.

Continue reading “UltraESB-X Monitoring with Kibana”

Implementing an Embedded ElasticSearch Server

Hi all, recently I added an embedded ElasticSearch server for the upcoming release of  AdroitLogic UltraESB. Embedded ES Server will be useful when a large ES cluster is not required and also for ES integration tests. Let’s have a look at the code.

import org.adroitlogic.logging.api.Logger;
import org.adroitlogic.logging.api.LoggerFactory;
import org.adroitlogic.ultraesb.api.monitoring.StatisticsServer;
import org.elasticsearch.client.Client;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.node.Node;

import static org.elasticsearch.node.NodeBuilder.nodeBuilder;

 * @author rajind
 * Implementation of embedded elasticsearch server.

public class ElasticSearchStatisticsServer implements StatisticsServer {

    private Node node;
    private static final Logger logger= LoggerFactory.getLogger(ElasticSearchStatisticsServer.class);

    private static final String ES_PROPERTY_PATH_HOME = "path.home";
    private static final String ES_PROPERTY_PATH_CONF = "path.conf";

     * Create an elasticsearch embedded node with provided default configuration.
    public ElasticSearchStatisticsServer() {

    public void init(String confDir, String homeDir) {
        try {
  "Embedded Elasticsearch server is initializing");
            Settings elasticsearchSetting = Settings.settingsBuilder()
                    .put(ES_PROPERTY_PATH_HOME, homeDir)
                    .put(ES_PROPERTY_PATH_CONF, confDir)
            node = nodeBuilder().settings(elasticsearchSetting).build().start();
        } catch (Exception e) {
            logger.warn("Could not init embedded elasticsearch node", e);

    public Client getClient() {
        if (node != null) {
            return node.client();
        } else {
            return null;

    public void destroy() {
        try {
  "Stopping embedded elasticsearch server");
        } catch(Exception e) {
            logger.warn("Could not stop embedded elasticsearch node due to {}", e.getMessage());

It’s actually very simple. “path.conf” will contain the elasticsearch configuration yaml file “elasticsearch.yml“. Please remember that “path.home” will always have to be set as elasticsearch looks for that by default.

Cheers! 🙂

~Rajind Ruparathna