Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

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

...

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

Image Modified

Apache Camel HTTP Get Operation

 Image Added

Apache Camel JMS Queue Receive

Image Added

Apache Camel Unknown ActiveMQ Queue Receive

Image Modified

Apache Camel HTTP Put Operation

 Image Added

Apache Camel JMS QueueCall

Image Added

Apache Camel Unknown ActiveMQ Queue Call

Image Modified

Apache Camel HTTP Post Operation

 Image Added

 Apache Camel Unknown JMS Queue Receive

Image Added

Apache Camel RabbitMQ Topic Receive

Image Modified

Apache Camel HTTP Delete Operation 

 Image Added

 Apache Camel Unknown JMS Queue Call

Image Added

Apache Camel RabbitMQ Topic Call

Image Modified

Apache Camel HTTP Any Operation 

 Image Added

Apache Camel IBM Queue Receive

Image Added

Apache Camel Unknown RabbitMQ Topic Receive

Image Modified

Apache Camel Route Call

 Image Added

Apache Camel IBM Queue Call

Image Added

Apache Camel Unknown RabbitMQ Topic Call

Image Modified

Apache Camel Route

 Image Added

Apache Camel Unknown IBM_Queue Receive

Image Added

Apache Camel File

Image Modified

Apache Camel Bean Call

 Image Added

Apache Camel Unknown IBM Queue Call

Image Added

Apache Camel File Call

Image Modified

Apache Camel Process Call

 Image Added

Apache Camel ActiveMQ Queue Receive

Image Added

Apache Camel Kafka Topic Receive

Image Modified

Apache Camel Database Query

 Image Added

Apache Camel ActiveMQ Queue Call

Image Added

Apache Camel Kafka Topic Call

Image Added

Apache Camel Unknown Kafka Topic Receive

Image Added

Apache Camel Unknown Kafka Topic Call

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

Expand


Code Block
languagexml
<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

Expand


Code Block
languagejava
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")
}

Image Added


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

Expand


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

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

Expand


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

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

Expand


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

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

Expand


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

Image Added

Java DSL - callLink between Apache Camel Route (seda)  and Apache Camel Route Call (direct)

Expand


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

Image Added

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

Expand


Code Block
languagexml
<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"/>

Image Added


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

Expand


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

Image Added


XML DSL - callLink between Apache Camel Route and Bean Call

Expand


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

callLinks in the complete transaction

Expand

Image Removed

Limitations

  • Route destinations such as bean, process, jdbc (database query jdbc:) and apache camel routes (direct:) are created as known objects
  • All other route components are ignored
  • There may be incorrect bookmarks in few call links. Will be fixed in subsequent releases

Future development

...

XML DSL - callLink between Apache Camel Route and Process Call

Expand


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

Image Added


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

Expand


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

Image Added


XML DSL - callLinks between REST Post Service and JDBC Query

Expand


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

Image Added


Code Block
languagexml
<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"/>

Image Added


Java DSL - callLink between REST Post Service and JDBC Query

Expand


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

Image Added

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

Image Added


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

Expand


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

Image Added

XML DSL - callLink between File and File Call

Expand


Code Block
languagexml
<to
<route id="
_to8"
fileRoute2">
	<from uri="
cancelNonDME2"
file:home/customers/new?fileName=new.xml"/>
    <to uri="
velocity:file:{{ajsc.vm.path}}/successResponse.vm" />
file://home/customers/old"/>
</route>

Image Added

Java DSL - callLink between File and File Call

Expand


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

Image Added

Java DSL - callLink between File and Bean Call

Expand


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

Image Added

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

Expand


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

Image Added

Java DSL - callLink between Kafka Topic Receive and File Call

Expand


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

Image Added

callLinks in the complete transaction

Expand

Image AddedImage AddedImage AddedImage Added

Image AddedImage Added

Image Added

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.
  • Any component created with a customized name will not be handled or created
  • There may be missing/multiple links instead of one between process call and process method of the target class
  • There may be multiple links instead of one between bean call and target method of the bean
  • There may be incorrect bookmarks in few call links and objects
  • 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
  • Consuming messages from multiple Kafka topics is not supported
  • 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.

Future development

  •  More Components Support, Better Linking, Fixing Bookmark Issue, Custom Component Support.