Versions Compared

Key

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

...

Now, that the schema/namespaces are declared, we can start to add addtional additional stuffs like import resources, beans reference, ... that our routing engine will use.

Step 1

...

: Webservice infrastructure : CXF

We will use the CXF framework to deploy the reportincident webservice and run it into the OSGI platform.

...

Remarks :
(1) - the address corresponds to the URI address of the web services,
(2) - the serviceClass is the name of the class used work with the webservices and deployed in the bundle reportincident.webservice
(3) - xmlns:s is the namespace of the reportincident webservice (see reportincident.webservice)

Step 2

...

: Queuing engine

No matter if the incidents come from a webservice or a files but before to process and save them in the database, we will put
our messages in a queue. The queue manager used here is ActiveMQ.
Like CXF, we will use spring xml file to deploy ActiveMq into the server and configure it. This will be done in two steps

...

All the infrastructure is in place, so we can start to describe the beans that we will use

Step 3

...

: Beans

...

references

5 beans will be used by our application :

...

Remarks :
(1) - An OutputReportIncident object is created because it will be used to send the message back to the webservice
(2) - The field/property setCode is setted with the value ("OK")
(3) - The method setOk() will be called by Camel routing

Step 4

...

: Routing

Now that evverything is in place, we can create the three routes that we need to implement the architecture that we have presented in the introduction of this tutorial

...

Remarks :
(1) - Classes required by Camel, CXF muste be imported.
(2) - Our internal classes are declared as private to avoid that they become available for another bundles of the OSGI server

Conclusion

TODOIn this section of the tutorial, we have discussed how to design the routing between endpoints/components of our application using Camel Spring DSL language. We have also investigated how to setup the infrastructure required to work with ActiveMq, any other queuing engine and CXF. In the next chapter, we will see how to create the web application, package the solution and deploy it on ServiceMix.

...