Pages

Sep 13, 2018

JBoss Fuse – Fuse workshop 101 – Part Four

By Christina Lin



This is probably the easiest part of the entire Camel 101 workshop. It’s very similar with Bean injection in Spring, so with the IoC in mind, in Camel we do the same thing.


First we create our POJO, In side each POJO has either your customize and the business logic, which are the most valuable part in the entire system, or just any helper code you would like to use while developing. The reason for this is to keep things easy to maintain and to have a much more light weight framework.


As soon as we got the POJO or Java Bean, we are ready to register it into the “Registry”. In Camel there are few registry available.



  • Simple

  • JNDI

  • ApplicationContext

  • OSGi


Basically, they are just different place to store your Registry, you can probably guess it by it’s name. We use SimpleRegistry mainly in Testing, when you want to use Maps to store your Registry. And obviously JNDI is the default in Camel project. And if you have Spring or OSGi you can always register it there! With JBoss Fuse Project, there is no need to worry about this. We use mostly ApplicationContextRegistry. Then we can “reference” this bean from the route within each Camel Context.


The diagram below shows you how to do it.



It’s as simple as that!

About the parameter you pass into the method of POJO, Camel is going to automatically map everything from the body for you, if you have not specifically specified in your reference. Camel actually use runtime look up, so don’t expect any error message of misconfigure or misspell during compilation time.


The slide for the workshop are here:



In this exercise, we continue on building the stock trading system, putting real business code that calculate how much money of this person that needs to deduct from this stock trade. As well as that, to speed up the process for VIPs, the vendor decide to introduce Messaging Queue to the game. We now need to deliver the trading into via messaging.



Lab instructions are here:


Here are the other parts of the workshops!

Workshop part 1 – Camel basic and components

Workshop part 2 – Data Transformation

Workshop part 3 – Enterprise Integration Pattern


Source::




by i88.ca via Social Marketing by I88.CA » i88.ca

QuickBooks Self-Employed

Bigger tax refunds. Better organization. Manage your deductions with QuickBooks Self-Employed .