Summary: This document provides basic information about the extension providing Apache Camel support for Java.

Extension ID

com.castsoftware.camel

What's new?

Please see Apache Camel - 1.0 - Release Notes for more information.

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.

Function Point, Quality and Sizing support

This extension provides the following support:

Function Points
(transactions)
(tick)
Quality and Sizing(error)

CAST AIP compatibility

This extension is compatible with:

CAST AIP releaseSupported
8.3.x(tick)
8.2.x(tick)

Supported DBMS servers

This extension is compatible with the following DBMS servers:

DBMSSupported
CSS/PostgreSQL(tick)
Oracle(tick)
Microsoft SQL Server(error)

Prerequisites

(tick)Installation of any compatible release of CAST AIP (see table above)

Download and installation instructions

Include the extension using the interface in AIP Console:

There is nothing further to do. Any Apache Camel configuration defined in XML files in the application source code will be automatically detected. Follow the instructions below to run a new analysis/snapshot to generate new results:

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

IconDescription Icon DescriptionIconDescription

Apache Camel HTTP Get Operation

 

Apache Camel JMS Queue Receive

Apache Camel Unknown ActiveMQ Queue Receive

Apache Camel HTTP Put Operation

 

Apache Camel JMS QueueCall

Apache Camel Unknown ActiveMQ Queue Call

Apache Camel HTTP Post Operation

 

 Apache Camel Unknown JMS Queue Receive

Apache Camel RabbitMQ Queue Receive

Apache Camel HTTP Delete Operation 

 

 Apache Camel Unknown JMS Queue Call

Apache Camel RabbitMQ Queue Call

Apache Camel HTTP Any Operation 

 

Apache Camel IBM Queue Receive

 

Apache Camel Unknown RabbitMQ Queue Receive

Apache Camel Route Call

 

Apache Camel IBM Queue Call

Apache Camel Unknown RabbitMQ Queue Call

Apache Camel Route

 

Apache Camel Unknown IBM_Queue Receive

Apache Camel Bean Call

 

Apache Camel Unknown IBM Queue Call

Apache Camel Process Call

 

Apache Camel ActiveMQ Queue Receive

 

Apache Camel Database Query

 

Apache Camel ActiveMQ Queue Call

Links

Only callLinks are created between various objects created by this extension.

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")
}


XML DSL - callLink between REST DELETE and Apache Camel Route Call


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

XML DSL - callLink between REST PUT and Apache Camel Route Call


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

XML DSL - callLink between ApacheCamel Route and Apache Camel Route Call


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

Java DSL - callLink between Apache Camel Route and Apache Camel Route Call


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(); 
}

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"));
}


XML DSL - callLink between Apache Camel Route and Bean Call


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

XML DSL - callLink between Apache Camel Route and Process Call


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


Java DSL - callLinks between Apache Camel Route and Bean Call, Process Call


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"); 
}


Java DSL - callLink between JMS Queue Receive and JMS Queue Call


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


callLinks in the complete transaction

Limitations

Future development