Skip to main content

Red Hat JBoss Fuse - Getting Started, Home Loan Demo Part 5

This is the last one of my getting started demo for JBoss FUSE 6.1. For people that are getting started to know Fuse, and wants to get their hands dirty and develop a JBoss Fuse project.

This series of videos are focused on playing with the integration framework in JBoss Fuse, which base on the open source project Apache Camel. In this video I am going deploy the integration projects onto the OSGi container and manage it with Fuse Fabric.

The story behind the home loan demo is we have a system, that takes in XML files from different vendor's home loan application into a folder, and we will need to process the data give house an appraised value and then provide the information back to the vendors. 

First demo was to take in and process the information, and put it into a message broker,  and the second demo,  was about processing the customer data, by reading the xml file and store it into a Postgres Database. The third demo, was slightly complex, by adding value to the house by the number of surrounding schools to the house. we referenced Google App Engine (Google Geocoding API to get the co-ordinate from Address, then use Google Places API to get number of surrounding schools) and then updated the new appraised value into house table in Postgres Database.

And from last demo, we have expose an restful web service endpoint for Vendors to query the new house value and data via customer's Nation ID. 

In this demo, the project is now ready to be deployed into a Testing environment. By using the fabric8 plugin in JBoss Fuse, we are going to start up JBoss Fuse, and create a broker and container in our Fuse management console. Deploy our project onto the OSGi container in JBoss Fuse 6.1. 



In this demo, you will learn, 

Deploy your Camel Project via Fabric8 plugin 
This plugin makes it easy to create or update a fabric profile from your maven project.
When you deploy your project to a fabric profile with this plugin the following takes place:

  • uploads any artifacts into the fabric's maven repository
  • lazily creates the fabric profile or version you specify
  • adds/updates the maven project artifact into the profile configuration
  • adds any additional parent profile, bundles or features to the profile.

Create a new container in JBoss Fuse
The Fabric in JBoss Fuse makes it really easy to provision, automate, configure, and manage from a central location

There is one thing I forgot to mention in the Video,
For Fabric8 plugin to deploy the profile into your JBoss Fuse, need to edit your ~/.m2/settings.xml file to add the fabric server's user and password so that the maven plugin can login to the fabric..

e.g. add this to the <servers> element:

<server>
  <id>fabric8.upload.repo</id>
  <username>admin</username>
  <password>admin</password>
</server> 



Thanks for following this series of getting started. :)


Comments

Charlie Wu said…
Christina 你好:
因JAVA工作關係也剛初碰JBPM,我有幾個JBPM的問題想要請教您

1. 有開放API可供外部呼叫嗎?例如由JAVA啟動flow
2. JBPM有平行會簽功能嗎?
3. 外部Web資料呈現是可以和JBPM流程拆開來的嗎?
4. 啟動流程有哪幾種方式呢?
Christina Lin said…
1. YES
2. jBPM 是只是流程不是簽合系統,你要怎麼設計你的系統功能都可以。
3. YES
4. Within Console, Restful service, KIE API
Netuh said…
Hi Christina,

Many thanks for all demos (demo 1 until 5)... I finally could understand step by step how to develop an application using Fuse ESB and JBDevStudio...

But I have some doubts...

If two activemq endpoints in two distinct containers have the same uri (for instance, activemq:customers) when some put a message there... will both receive? Or just the one inside the container?

Considering two activemq endpoints in the same container and with same Uri... when some put a message there, both endpoints will receive the message or just the first to "listen".

PS: Sorry in asking in english... and if my questions dont make sense
Christina Lin said…
Hi Netuh,

So it depends on where your activemq brokerURL has pointed to. If you start up a queue in a as single standalone broker, then the serve separately, and should all have different IP or Port. So in your brokerURL you point to the one you want to connect. On the other hand, if you use vm in your brokerURL then you will be using the local broker. :) Hope this helps!
Christina Lin said…
Hi Netuh,

So it depends on where your activemq brokerURL has pointed to. If you start up a queue in a as single standalone broker, then the serve separately, and should all have different IP or Port. So in your brokerURL you point to the one you want to connect. On the other hand, if you use vm in your brokerURL then you will be using the local broker. :) Hope this helps!
Netuh said…
Hello Christina Lin,

Thank you for the answer. That was what I would like to know. I will make some test in order to learn how to configure the activemq brokerURL. =)

Many thanks,
Neto
Netuh said…
Hello again Christina,

I was making some experiments to understand better the JBoss Technologies.

As I said, I had followed your "Getting Started, Home Loan Demo" (part 1 until 5).

However, instead of putting all the blueprint file in the same folder. I created a Fuse Project for each blueprint.

And configuring the ActiveMQ beans with (as the Demo presents):
name="brokerURL" value="vm://localhost"

The projects run but they dont receive the messages from the others projects (maybe because each project is a different VM)

I saw some examples configuring them with:
name="brokerURL" value="tcp://localhost:61616"

However, I got the following error message:

[read #0 - JmsConsumer[newdata]] ultJmsMessageListenerContainer ERROR Could not refresh JMS Connection for destination 'newdata' - retrying in 5000 ms. Cause: Error while attempting to add new Connection to the pool; nested exception is javax.jms.JMSException: Could not connect to broker URL: tcp://localhost:61616. Reason: java.net.ConnectException: Connection refused

Do you have any idea of how letting a ActiveMQ bean to listen a port in localhost, instead to listen to vm:localhost?
Andrew said…
Hi Christina,

I enjoyed the video you provided. It is very helpful. Unfortunately, I got an error at the first video. Everything is smooth until I added the unmarshal. I got this message.
Caused by: java.lang.IllegalArgumentException: Data format 'jaxb' could not be created. Ensure that the data format is valid and the associated Camel component is present on the classpath
at org.apache.camel.model.DataFormatDefinition.getDataFormat(DataFormatDefinition.java:90)
at org.apache.camel.model.DataFormatDefinition.getDataFormat(DataFormatDefinition.java:80)
at org.apache.camel.model.UnmarshalDefinition.createProcessor(UnmarshalDefinition.java:162)
at org.apache.camel.model.ProcessorDefinition.createProcessor(ProcessorDefinition.java:460)
at org.apache.camel.model.ProcessorDefinition.createOutputsProcessor(ProcessorDefinition.java:429)
at org.apache.camel.model.ProcessorDefinition.createOutputsProcessor(ProcessorDefinition.java:159)
at org.apache.camel.model.ProcessorDefinition.createChildProcessor(ProcessorDefinition.java:178)
at org.apache.camel.model.SplitDefinition.createProcessor(SplitDefinition.java:101)
at org.apache.camel.model.ProcessorDefinition.createProcessor(ProcessorDefinition.java:460)
at org.apache.camel.model.ProcessorDefinition.createOutputsProcessor(ProcessorDefinition.java:429)
at org.apache.camel.model.ProcessorDefinition.createOutputsProcessor(ProcessorDefinition.java:159)
at org.apache.camel.model.ExpressionNode.createFilterProcessor(ExpressionNode.java:109)
at org.apache.camel.model.WhenDefinition.createProcessor(WhenDefinition.java:77)
at org.apache.camel.model.WhenDefinition.createProcessor(WhenDefinition.java:31)
at org.apache.camel.model.ProcessorDefinition.createProcessor(ProcessorDefinition.java:460)
at org.apache.camel.model.ChoiceDefinition.createProcessor(ChoiceDefinition.java:135)
at org.apache.camel.model.ProcessorDefinition.makeProcessor(ProcessorDefinition.java:500)
at org.apache.camel.model.ProcessorDefinition.addRoutes(ProcessorDefinition.java:213)
at org.apache.camel.model.RouteDefinition.addRoutes(RouteDefinition.java:909)
... 28 more
Do you have any idea what is missing?

Thanks,
Andrew
Netuh said…
Hello Andrew,

Maybe on that one I can help you. =)

Are you sure that you put all dependences on pom.xml. In particular the "camel-jaxb".

You can get all the source code from: https://github.com/weimeilin79/homeloan-part1

I hope it can help you.

Netuh
juano said…
I have a problem when I run: mvn fabric8:deploy, got the following error:


[ERROR] Failed to execute goal io.fabric8:fabric8-maven-plugin:1.2.0.redhat-075:deploy (default-cli) on project homeloan
: Failed to update metadata org.blogdemo:homeloan:1.0.0-SNAPSHOT/maven-metadata.xml: Could not parse metadata C:\Users\j
gbv141114\.m2\repository\org\blogdemo\homeloan\1.0.0-SNAPSHOT\maven-metadata-fabric8.upload.repo.xml: end tag name /head must be the same as start tag link from line 14 (position: TEXT seen ...guage="javascript" src="/en/Default/securit
y.js"/script\n/head'... @18:8) -> [Help 1]
juano said…
This comment has been removed by the author.
Ashlyine Brooke said…
I got this blog site through my friends and when I searched this really there were informative articles at the place.end of nc payday loans
Herry Pat said…
Thanks fellow your posts are really very good for me since it make good sense for me. payday loans direct lenders
Nikhil Pandey said…

Read your blog its really informative and helpful keep updating with newer post on Home loan

Popular posts from this blog

JBoss EAP 6 - 效能調校 (一) DataSource 的 Connection Pool

效能沒有什麼Best Practice, 反正能調整的就那些。 通常,一個程式的效能大概有70-80% 都跟程式怎麼寫的其實比較有關係。

最近我最疼愛的小貓Puji 因為膀胱結石開刀的時候過世了,心情很差請原諒我的口氣沒有很好,也沒有心情寫部落格。

Puji R.I.P.

=======================正文=======================

這個題目很多人叫我寫,可是這題目好大,這分明就是整死我咩~
所以我會分幾段慢慢寫。

JBoss 的 SubsystemDatasource WebWeb Service EJB Hibernate JMSJCAJVM 調校OS (作業系統)

先來看一下 DataSource Subsystem, DataSource 的部分主要是針對Connection Pool 做調校。

通常,程式都會需要跟資料庫界接,電腦在本機,尤其是在記憶體的運算很快,但是一旦要外部的資源連接,就是會非常的耗資源。所以現在的應用程式伺服器都會有個Pool 放一些先連接好的 資料庫connection,當程式有需要的時候就可以馬上提供,而不用花那些多餘的資源去連接資料庫。

這就是為什麼要針對Connection Pool 去做調校。

以下會討論到的參數,都是跟效能比較有關係,Datasource 還有很多參數,像是檢核connection 是否正確的,我都不會提到。如果你追求的是非常快速的效能,那我建議你一個檢核都不要加。當然,這樣就會為伺服器上面執行的程式帶來風險。這就是你要在效能與正確,安全性上面的取捨了。 (套句我朋友說的話,不可能又要馬兒好,又要馬兒不吃草的..)

最重要的調校參數就是 Connection 的 Pool 數量。(也就是那個Pool 裡面要放幾條的connection.) 這個參數是每一個應用程式都不一樣的。

min-pool-size 

Connection Pool 最少會存留的connection 數量

max-pool-size 

Connection Pool 最多可以開啓的 connection 數量

prefill

事先將connection pool 裡面建立好min-pool-size 的connection.

我的建議是觀察一下平常程式要用到的量設定為 min-pool-size 。
加上…

Red Hat JBoss Fuse/A-MQ - Fuse and A-MQ Version 6.3 GA is released!

Fuse and A-MQ 6.3 GA has just went out. Maybe, you would think this is just only a minor version release why should I care? Hold your thoughts on that! Because they have done a lot of improvements and also added many new features into this release.

Besides various bug fixes and making sure Fuse Fabric is much more stable. There are two major change in this version update:

New Tooling in JBoss Developer Studio (JBDS) 9.1 GA. Newer Apache Camel version – Camel v2.17. I was really impressed by the work put in to make developing Camel application much simpler. First is the installation of tooling itself. Now it has a all-in-one installer so you don't need to worry about which plugins you need to check. See the videos below to see the new "Getting Started" of Fuse 6.3.



And If you notice from the above video, the presentation of camel route in JBDS has also updated. It fixed some of the miss representation of logic and making it easier to read.

Old Camel Route
New Camel Route
On …

Red Hat JBoss Fuse - Getting Started with Fuse Integration Service 2.0 Tech preview

I just realized that I did not do a getting started for Fuse Integration Service 2.0 Tech preview before I did the pipeline demo, thanks for those of you who reminded me! :)

To get started with FIS 2.0, for people who has just getting to know the technology, here is how I interpret it. Basically, it's divide into two aspect,

1. Integration development, FIS uses Apache Camel as the core technology that creates, orchestrate, compose microservices into a super lightweight thin integration layer, and become the API provider and service orchestrator through exposing RESTful or messaging service endpoints. And you can choose to either package and run it with Spring-Boot or Karaf.


2. Application Deployment and Management, FIS takes advantages of OpenShift platform, and allows you to separately deploy the micro-integration service among distributed environment, at the same time takes care of the failover, high availability, load balancing and service lookup problem for you.


So, now we know …