Skip to main content

Posts

How to write a Synapse Handler for the WSO2 ESB ?

Synapse handler is new feature which come with the ESB 4.9.0. It provide abstract handler implementation to the users. User can create their own concrete handlers which is executing in the synapse layer. Main intention of this blog post is to explain how to write synapse handler and explain basic theoretical background. 1. What is the handler? Handlers are basically talking with the chain of responsibility pattern. Chain of responsibility allows a number of classes to attempt to handle a request independently of any other object along the chain. Once the request is handled, it completes it's journey through the chain. The Handler defines the interface which required to handle the request and concreteHandlers handle request in a specific manner that they are responsible for. 2. What is Synapse handler? Synapse handler is providing abstract handle implementation which executes in the following four scenarios. 1. Request in flow This is exe...

How Schedule failover message processor helps for the guaranteed delivery ?

Before we talk about the failover message forwarding processor, it’s better to understand the big picture of the concepts and use cases. The Scheduled Failover Message Forwarding Processor is part of the bigger picture of the   message store and message processor . Message Store Message Processor. WSO2 ESB’s Message-stores and Message-processors   are used to store incoming messages and then deliver them to a particular backend with added Quality of Services (QoS), such as throttling and guaranteed delivery. The basic advantage of the MSMP is that it allows you to send messages reliably to a backend service. These messages can be stored in a different reliable storage such as JMS, JDBC message stores. The MSMP powered by three basic components: 1. Store Mediator. The Store mediator is the synapse mediator and can be used to store messages in the message store. 2. Message Store. A message store is storage in the ESB for messages. The WSO2 ESB comes with four t...

Illegal key size or default parameters

When you run the pre-defined security scenarios in the WSO2 ESB most probably you already faced the Illegal key size or default parameters exception org.apache.axis2.AxisFault: Error in encryption     at org.apache.rampart.handler.RampartSender.invoke(RampartSender.java:76)     at org.apache.axis2.engine.Phase.invokeHandler(Phase.java:340)     at org.apache.axis2.engine.Phase.invoke(Phase.java:313)     at org.apache.axis2.engine.AxisEngine.invoke(AxisEngine.java:261)     at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:426)     at org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOperation.java:398)     at org.apache.axis2.description.OutInAxisOperationClient.executeImpl(OutInAxisOperation.java:224)     at org.apache.axis2.client.OperationClient.execute(OperationClient.java:149)     at org.apache.axis2.client.Ser...

How to preserving HTTP headers in WSO2 ESB 4.9.0 ?

Preserving HTTP headers are important when executing backend services via applications/middleware. This is because most of the time certain important headers are removed or modified by the applications/middleware which run the communication. The previous version of our WSO2 ESB, version 4.8.1, only supported “ server ” and “ user agent ” header fields to preserve with, but with the new ESB 4.9.0, we’ve introduced a new new property ( http.headers.preserve ) for the passthru ( repository/conf/ passthru-http.properties ) and Nhttp( repository/conf/ nhttp.properties ) transporters to preserve more HTTP headers. Passthru transporter – support header fields               Location Keep-Alive Content-Length Content-Type Date Server User-Agent Host Nhttp transport – support headers Server User-Agent Date You can specify header fields which should be preserved in a comma-separated list, as shown below. http.headers.p...

How to enable proxy service security in ESB 4.9.0?

Security is  one of the major concern when we developing API base integrations or application developments. WSO2 supports WS Security , WS-Policy and WS-Security Policy specifications. These specifications define a behavior model for web services. Proxy service security requirements are different from each others. WSO2 ESB providing pre-define commonly used twenty security scenarios to choose based on the security requirements. This functionality is provided by the security management feature which is bundled by default in service management feature in ESB. This configuration can be done via the web console until ESB 4.8.1 release, but this has been removed from the ESB 4.9.0. Even though this feature isn't provided by the ESB web console itself same functionality can be achieved by the new WSO2 Dev Studio . WSO2 always motivate to use dev studio to prepare required artifacts to the ESB rather than the web console. Better way to explain this scenario is by example. Following...

No snappyjava in java.library.path Exception when running WSO2 Message Broker 2.2.0 in MAC OS

You can see the following exception when you running WSO2 MB 2.2.0 top of the MAC OS. java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.xerial.snappy.SnappyLoader.loadNativeLibrary(SnappyLoader.java:317) at org.xerial.snappy.SnappyLoader.load(SnappyLoader.java:219) at org.xerial.snappy.Snappy. (Snappy.java:44) at org.apache.cassandra.io.compress.SnappyCompressor.create(SnappyCompressor.java:45) at org.apache.cassandra.io.compress.SnappyCompressor.isAvailable(SnappyCompressor.java:55) at org.apache.cassandra.io.compress.SnappyCompressor. (SnappyCompressor.java:37) at org.apache.cassandra.config.CFMetaData. (CFMetaData.java:82) at org.apache.cassandra.config.KSMetaDa...

MQ Telemetry Transport Protocol for IOT

MQTT protocol is a lightweight, open and simple network protocol for the device communications. It  is  based on the principle of publishing messages and subscribing to topics, or "pub/sub".  The protocol runs over TCP/IP, or over other network protocols that provide ordered, lossless, bi-directional connections. It was designed for the  low-bandwidth, high latency networks in the late 1990s/early 2000s and its support to connect over thousands of clients to a single server. This characteristic is a suite for the devices which has very limited processing powers and limited memory, such as sensors, mobile devices, monitoring devices. Since It provides a common interface for everything, new sensors or devices can integrate very easily with the system.   Message in MQTT is published on topics. These topics are treated as a  hierarchy separate using slash(/) as a separator like in  the file system. Clients can receive messages ...