Skip to content


Inbuilt JSON marshalling component: Transforms to and from JSON using the ultra-fast Jackson library

For more information about json-jackson:


Transforms the Log object emitted by the web3j component to a JSON string:

import org.apache.camel.model.dataformat.JsonLibrary

def ethClientURL = p6.appconfig.get('ethClientURL')
def contractAddress =  p6.appconfig.get('contractAddress')

p6.camel.getCtx().addRoutes(new RouteBuilder() {
    void configure() {
    from("web3j://" + ethClientURL + "?address=" + contractAddress + "&operation=ETH_LOG_FLOWABLE")
        .setHeader("Content-Type", constant("application/json; charset=utf-8"))
        .routeId("p6_demo Web3j - BlockchainEventHandler")
        .description("p6_demo Blockchain Event Handler")


If you want to read the result of this JSON marshalling component transformation using the pipeline (in a script for example) you need to set the contentType header with a charset (as shown before). By default, the result of the transformation does not contain the charset.