Apache Camel - 1.1


Compatibilty: v2 v3 Cloud
What's new? Release Notes
ID: com.castsoftware.camel

Description

Apache Camel is an open-source integration framework that provides a rule-based routing and mediation engine to seamlessly connect diverse systems, applications, and protocols.

This extension adds support for analyzing Apache Camel communication operations across multiple channels—including HTTP-based interactions, messaging systems such as Kafka, file movements, inter-process communication, and database integrations like MongoDB and others.

It supports both Java DSL and XML-based route definitions, enabling comprehensive coverage of Camel’s integration patterns and components.

In what situation should you install this extension?

This extension should be installed when your Java application consists of Apache Camel Routes. Objects created for the components encountered in Apache Camel Route are linked to objects produced by the JEE Analyzer. This will result in better transactions and calculation of Automated Function Points.

Technology support

The following libraries are supported by this extension:

Library name Version Supported Supported Technology
camel-core-model 3.7.x to 4.16.x Java
camel-core-engine 3.0.x to 4.6.x Java
camel-seda 3.0.x to 4.6.x Java

Function Point, Quality and Sizing support

  • Function Points (transactions): a green tick indicates that OMG Function Point counting and Transaction Risk Index are supported
  • Quality and Sizing: a green tick indicates that CAST can measure size and that a minimum set of Quality Rules exist
Function Points (transactions) Quality and Sizing

Download and installation instructions

For Java applications using any of the above mentioned libraries, this extension will be automatically installed. This is in place since January 27, 2021.

For upgrade, if the Extension Strategy is not set to Auto update, you can manually upgrade the extension using the Application - Extensions interface.

What results can you expect?

Once the analysis/snapshot generation is completed, you can view the results in the normal manner (for example via CAST Enlighten):

Objects

Icon Description
Apache Camel HTTP Get Operation
Apache Camel HTTP Put Operation
Apache Camel HTTP Post Operation
Apache Camel HTTP Delete Operation
Apache Camel HTTP Any Operation
Apache Camel Route Call
Apache Camel Route
Apache Camel Bean Call
Apache Camel Process Call
Apache Camel Database Query
Apache Camel Unknown Kafka Topic Receive
Apache Camel JMS Queue Receive
Apache Camel JMS QueueCall
Apache Camel Unknown JMS Queue Receive
Apache Camel Unknown JMS Queue Call
Apache Camel IBM Queue Receive
Apache Camel IBM Queue Call
Apache Camel Unknown IBM_Queue Receive
Apache Camel Unknown IBM Queue Call
Apache Camel ActiveMQ Queue Receive
Apache Camel ActiveMQ Queue Call
Apache Camel Unknown Kafka Topic Call
Apache Camel Unknown ActiveMQ Queue Receive
Apache Camel Unknown ActiveMQ Queue Call
Apache Camel RabbitMQ Topic Receive
Apache Camel RabbitMQ Topic Call
Apache Camel Unknown RabbitMQ Topic Receive
Apache Camel Unknown RabbitMQ Topic Call
Apache Camel File
Apache Camel File Call
Apache Camel Kafka Topic Receive
Apache Camel Kafka Topic Call
Apache Camel MongoDB collection
Apache Camel unknown MongoDB collection
Apache Camel MongoDB database
Apache Camel unknown MongoDB database
Apache Camel AWS S3 Bucket
Apache Camel AWS Unknown S3 Bucket
Link Type Source of link Destination of link Supported APIs
callLink
Apache Camel caller objects Apache Camel HTTP Get Operation
Apache Camel HTTP Put Operation
Apache Camel HTTP Post Operation
Apache Camel HTTP Delete Operation
Apache Camel HTTP Any Operation
Apache Camel Route
Apache Camel JMS Queue Receive
Apache Camel IBM Queue Receive
Apache Camel Unknown IBM_Queue Receive
Apache Camel ActiveMQ Queue Receive
Apache Camel RabbitMQ Topic Receive
Apache Camel File
Apache Camel Kafka Topic Receive
Apache Camel Unknown Kafka Topic Receive
Apache Camel Unknown JMS Queue Receive
Apache Camel Unknown ActiveMQ Queue Receive
Apache Camel Unknown RabbitMQ Topic Receive
Apache Camel callee objects Apache Camel JMS QueueCall
Apache Camel Route Call
Apache Camel Bean Call
Apache Camel Process Call
Apache Camel Database Query
Apache Camel IBM Queue Call
Apache Camel ActiveMQ Queue Call
Apache Camel RabbitMQ Topic Call
Apache Camel File Call
Apache Camel Kafka Topic Call
Apache Camel AWS S3 Bucket
Apache Camel AWS Unknown S3 Bucket
Apache Camel Unknown JMS Queue Call
Apache Camel Unknown IBM Queue Call
Apache Camel Unknown Kafka Topic Call
Apache Camel Unknown ActiveMQ Queue Call
Apache Camel Unknown RabbitMQ Topic Call
API’s to fetch caller objectorg.apache.camel.builder.RouteBuilder.from
org.apache.camel.model.RouteDefinition.routeId

API’s to fetch callee objectorg.apache.camel.model.ProcessorDefinition.to
org.apache.camel.model.ProcessorDefinition.toD
org.apache.camel.model.ProcessorDefinition.recipientList
org.apache.camel.model.ProcessorDefinition.bean
org.apache.camel.model.ProcessorDefinition.setBody
org.apache.camel.builder.ExpressionClause.simple
org.apache.camel.model.ProcessorDefinition.process
callLink Apache Camel Bean Call object Java class object
API’s to fetch caller objectorg.apache.camel.model.ProcessorDefinition.bean
callLink Apache Camel Process Call object Java method object
API’s to fetch caller objectorg.apache.camel.model.ProcessorDefinition.process
useSelectLink
useInsertLink
useUpdateLink
useDeleteLink
Apache Camel caller objects Apache Camel HTTP Get Operation
Apache Camel HTTP Put Operation
Apache Camel HTTP Post Operation
Apache Camel HTTP Delete Operation
Apache Camel HTTP Any Operation
Apache Camel Route
Apache Camel JMS Queue Receive
Apache Camel IBM Queue Receive
Apache Camel Unknown IBM_Queue Receive
Apache Camel ActiveMQ Queue Receive
Apache Camel RabbitMQ Topic Receive
Apache Camel File
Apache Camel Kafka Topic Receive
Apache Camel Unknown Kafka Topic Receive
Apache Camel Unknown JMS Queue Receive
Apache Camel Unknown ActiveMQ Queue Receive
Apache Camel Unknown RabbitMQ Topic Receive
Apache Camel callee objects Apache Camel MongoDB collection
Apache Camel unknown MongoDB collection
Apache Camel AWS S3 Bucket
Apache Camel AWS Unknown S3 Bucket
API’s to fetch caller objectorg.apache.camel.builder.RouteBuilder.from
org.apache.camel.model.RouteDefinition.routeId
org.apache.camel.model.ProcessorDefinition.bean
org.apache.camel.builder.ExpressionClause.simple
org.apache.camel.model.ProcessorDefinition.process
Apache Camel callee objects org.apache.camel.model.ProcessorDefinition.to
org.apache.camel.model.ProcessorDefinition.toD
org.apache.camel.model.ProcessorDefinition.recipientList

Code examples

XML DSL- callLink between REST POST service and Apache Camel Route Call

<rest path="restservices/sapmp/v1/cart/">
            <post uri="/addCart">
                <to uri="direct:addCart" />
             </post>

Java DSL- callLink between REST POST service and Apache Camel Route Call

public void subscriberServiceRoute() {

      ajscRoute.setRoute(from("restlet:/subscriber/subscribernotifications?restletMethods=POST&restletBinding=#customBinding")
    .log(" Determine the event type ")
        .choice()
    .when().simple("${body} =~ '" + SubscriberConstants.CANCEL_SUBSCRIBER + "'").to("direct:cancelSubscriber")
}

<delete uri="/order/modify/modifyOrder">
                <to uri="direct:modifyOrder" />            
</delete>

<put uri="/order/modify/modifyOrder">
                <to uri="direct:modifyOrder" />            
</put>

<from uri="direct:submitOrder" />
    <to uri="direct:fanAuthorization" />

public class MongoDBInsertRouteBuilder extends RouteBuilder {

    @Override
 public void configure() {
        if (replicationBatch) {
            from("jms:queue://" + replicationNode.getDestination() + "?disableReplyTo=true&concurrentConsumers=" + replicationNode.getMaxCapacity())
                    .process(new JmsReplyProcessor(false))
                    .to("bean:securityContextHelper?method=createBatchServerSecurityContext");
        }
    }

Java DSL - useInsertLink between REST POST and MongoDB Collection

public class MongoDBInsertRouteBuilder extends RouteBuilder {

    @Override
    public void configure() {
        from("jetty:http://0.0.0.0:8081/hello?httpMethodRestrict=POST")
                .log("Called insert API")
                .to("mongodb:myDb?database=test&collection=test&operation=insert")
                .setBody(simple("${body}"));
    }
}

public class AwsRouteBuilder extends RouteBuilder {

    @Override
    public void configure() {
        from("jetty:http://0.0.0.0:8081/s3?httpMethodRestrict=GET")
                .log("Called s3 delete API")
                .to("aws2-s3://customer-cart?amazonS3Client=#s3Client&operation=deleteBucket")
                .setBody(simple("${body}"));
    }
}

public void unenroll()
{
      from("direct:unenrollSubscriber")
      .process("prepareInputToUnEnroll")
   .to("invokeUnenrollService")
        .log("Unenroll Service Status Code in MobileSplit :: ${in.headers.CamelHttpResponseCode}")
        .choice()
        .when().simple("${in.headers.CamelHttpResponseCode} =~ "+ "'"+SubscriberConstants.RESPONSE_SUCCESS_CODE+"'"
          + " || ${in.headers.CamelHttpResponseCode} =~ '"+SubscriberConstants.ACCEPTED_CODE+"'")
           .to("direct:retireRecord")
           .process(SubscriberConstants.RESPONSE_HANDLER)
        .otherwise()
             .setBody().constant(SubscriberConstants.MESSAGE_UNENROLLMENT_UNSUCCESSFUL)
             .process(SubscriberConstants.RESPONSE_ERROR_HANDLER)
        .endChoice().end(); 
}

public void configure() throws Exception {
    from("seda:largeListConsumer?concurrentConsumers=1&size=1000&timeout=0&blockWhenFull=true")
                .routeId("largeListConsumer")
                .to("direct:processFile")
                .end();
}

XML DSL - callLinks between Rest POST service and Bean Call, Process Call

<from id="_from1" uri="restlet:/addp/v1/account/profiles?restletMethods=POST&restletBinding=#customBinding"/>
        <doTry id="_doTrymp">
            <to id="_to_MAN1" uri="bean:restServiceImpl?method=manageProfile"/>
            <process id="_manageProfileService" ref="manageProfileService"/>

Java DSL - callLinks between Rest POST service and Bean Call, Process Call

public void subscriberServiceRoute()
{
      ajscRoute.setRoute(from("restlet:/subscriber/subscribernotifications?restletMethods=POST&restletBinding=#customBinding")
        .bean("SubscriberNotificationBeans","getSubscriberNotifications(exchange)")
     .process("decideEventType"));
}

<from uri="direct:submitOrder" />
  <interceptFrom id="_interceptFrom2">
     <to id="submitOrderCamelInterceptor" uri="bean:camelInterceptor?method=invokepreInterceptorChain" />
  </interceptFrom>

<from id="_from_D4" uri="direct:fanAuthorization" />
  <process ref="prepareProfileInputData" />

public void cancelSubscriber() {
    from("direct:cancelSubscriber").process("prepareInputToAddpDeviceDetails") 
                                       .bean("inquireEnterpriseDeviceDeploymentDetails", "inquireDeviceDetailsByCtn(${body})");
}

XML DSL - callLinks between REST Post Service and JDBC Query

<from uri="restlet:/user?restletMethod=POST"/>
          <setBody>
                <simple>select * from user ORDER BY id desc LIMIT 1</simple>
            </setBody>
            <to uri="jdbc:dataSource"/>        

<route id="createUser">
            <from uri="restlet:/user?restletMethod=POST"/>
            <setBody>
                <simple>insert into user(firstName, lastName) values('${header.firstName}','${header.lastName}');  
                    CALL IDENTITY();               
        </simple>
            </setBody>
            <to uri="jdbc:dataSource"/>

Java DSL - callLink between REST Post Service and JDBC Query

public void configure() {
    from("restlet:/user?restletMethod=POST")
    .setBody(simple("select * from user ORDER BY id desc LIMIT 1"))
        .to("jdbc:dataSource");
}

public void configure() {  
   from("restlet:/user/{userId}?restletMethods=GET,PUT,DELETE")
     .setBody(simple("update user set firstName='${header.firstName}', lastName='${header.lastName}' where id = ${header.userId}"))
         .to("jdbc:dataSource"); 
}

public void configure() throws Exception 
{
   from("jms:JmsQueue").bean(ProcessingBean.class, "doSomething").to("jms:redirected");
}

<route id="fileRoute2">
    <from uri="file:home/customers/new?fileName=new.xml"/>
    <to uri="file://home/customers/old"/>
</route>

public void configure() throws Exception {
    from("file:home/customers/old")
                .routeId("transfer")
                .log(LoggingLevel.INFO, "com.toyota.tme.cws.transform.route.error", "Transferring File - ${file:name}")
                .to("file:home/customers/new")
                .end();
}

public void configure () throws Exception {
    from("file://inputdir?fileName=order.xml")
                .routeId("readFilefromDir")
                .log(LoggingLevel.INFO, "com.toyota.tme.cws.transform.route.error", "Processing File - ${file:name}")
                .bean("FileBusiness", "moveToSedaQueue")
                .end();
}

public void configure () throws Exception {
    from("direct:start")       
            .to("kafka:localhost:8080?topic=testkafkaprod3");
}

public void configure () throws Exception {
    from("kafka:localhost:8080?topic=testkafkacon1&zookeeperHost=localhost&zookeeperPort=2181&groupId=group1").to("file:input");
}

Limitations

  • Unknown queue/process/bean/route/file/jms/kafka object is created in case where the exact name can’t be retrieved
  • Routes defined using route templates result in unknown route objects 
  • All other route components are ignored. Any Route starting with a component not mentioned in the Object section , the whole of the Route with its components will be ignored.
  • One of the signature for the overloaded method idempotentConsumer method of org.apache.camel.model.ProcessDefinition is not supported. This suspends the creation of the objects for the components in that route following this method.
  • Current version does not support Kafka topic using Kafka idempotent repository
  • Kafka topic receive/call object is always created by the name whatever is present in Kafka component topic. There is a possibility that name mentioned of the topic is an alias and refers to something else. Due to some design constraints, it will not be evaluated to refer to the exact value. Hence, object will be created in the name present in Kafka component.
  • In case of AWS-S3 copy operation, only source bucket is considered currently.