Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

...

Info

If this is the first time that Karaf is started, then you will see that a new data folder is created. This directory will contain subfolders :

  • cache : containing the bundlles deployed
  • log : where the log file is updated by the application

Step 2 : Check osgi list

When the following prompt appears on the screen :

...

Code Block
karaf@root> features:list

...

State         Version        Name                     Repository
[installed  ] [2.2.0       ] camel                    repo-0

...


[installed  ] [2.2.0       ] camel-core               repo-0

...


[installed  ] [2.2.0       ] camel-spring-osgi        repo-0

...


[uninstalled] [2.2.0       ] camel-spring             repo-0

...


[uninstalled] [2.2.0       ] camel-osgi               repo-0

...


[uninstalled] [2.2.0       ] camel-test               repo-0

...


[installed  ] [2.2.0

...

       ] camel-cxf                repo-0

...


[uninstalled] [2.2.0       ] camel-cache              repo-0

...


[uninstalled] [2.2.0       ] camel-castor             repo-0

...


[uninstalled] [2.2.0       ] camel-dozer              repo-0

...


[uninstalled] [2.2.0       ] camel-http               repo-0

...


[uninstalled] [2.2.0

...

       ] camel-mina               repo-0

...


[uninstalled] [2.2.0       ] camel-jetty              repo-0

...


[uninstalled] [2.2.0       ] camel-servlet            repo-0

...


[installed  ] [2.2.0       ] camel-jms                repo-0

...


[uninstalled] [2.2.0       ] camel-amqp               repo-0

...


[uninstalled] [2.2.0

...

       ] camel-atom               repo-0

...


[uninstalled] [2.2.0       ] camel-bam                repo-0

...


[installed  ] [2.2.0       ] camel-bindy              repo-0

...


[uninstalled] [2.2.0       ] camel-cometd             repo-0

...


[uninstalled] [2.2.0       ] camel-csv                repo-0

...


[uninstalled] [2.2.

...

0       ] camel-flatpack           repo-0

...


[uninstalled] [2.2.0       ] camel-freemarker         repo-0

...


[uninstalled] [2.2.0       ] camel-ftp                repo-0

...


[uninstalled] [2.2.0       ] camel-guice              repo-0

...


[uninstalled] [2.2.0       ] camel-groovy             repo-0

...


[uninstalled] [2.2.0

...

       ] camel-hl7                repo-0

...


[uninstalled] [2.2.0       ] camel-ibatis             repo-0

...


[uninstalled] [2.2.0       ] camel-irc                repo-0

...


[uninstalled] [2.2.0       ] camel-jaxb               repo-0

...


[uninstalled] [2.2.0       ] camel-jcr                repo-0

...


[uninstalled] [2.2.0

...

       ] camel-jing               repo-0

...


[uninstalled] [2.2.0       ] camel-jdbc               repo-0

...


[uninstalled] [2.2.0       ] camel-josql              repo-0

...


[uninstalled] [2.2.0       ] camel-jpa                repo-0

...


[uninstalled] [2.2.0       ] camel-jxpath             repo-0

...


[uninstalled] [2.2.0       ] camel-juel               repo-0

...


[uninstalled] [2.2.0       ] camel-ldap               repo-0

...


[uninstalled] [2.2.0       ] camel-mail               repo-0

...


[uninstalled] [2.2.0       ] camel-msv                repo-0

...


[uninstalled] [2.2.0       ] camel-mvel               repo-0

...


[uninstalled] [2.2.0       ] camel-ognl               repo-0

...


[uninstalled] [2.2.0       ] camel-printer            repo-0

...


[uninstalled] [2.2.0       ] camel-protobuf           repo-0

...


[uninstalled] [2.2.0       ] camel-quartz             repo-0

...


[uninstalled] [2.2.0       ] camel-restlet            repo-0

...


[uninstalled] [2.2.0       ] camel-rmi                repo-0

...


[uninstalled] [2.2

...

.0       ] camel-rss                repo-0

...


[uninstalled] [2.2.0       ] camel-saxon              repo-0

...


[uninstalled] [2.2.0       ] camel-scala              repo-0

...


[uninstalled] [2.2.0       ] camel-script             repo-0

...


[uninstalled] [2.2.0       ] camel-smpp               repo-0

...


[uninstalled] [2.2.

...

0       ] camel-snmp               repo-0

...


[uninstalled] [2.2.0       ] camel-spring-integration repo-0

...


[uninstalled] [2.2.0       ] camel-sql                repo-0

...


[uninstalled] [2.2.0       ] camel-stream             repo-0

...


[uninstalled] [2.2.0       ] camel-string-template    repo-0

...


[uninstalled] [2.2.0       ] camel-tagsoup            repo-0

...


[uninstalled] [2.2

...

.0       ] camel-velocity           repo-0

...


[uninstalled] [2.2.0       ] camel-xmlbeans           repo-0

...


[uninstalled] [2.2.0       ] camel-xmlsecurity        repo-0

...


[uninstalled] [2.2.0       ] camel-xmpp               repo-0

...


[uninstalled] [2.2.0       ] camel-xstream            repo-0

...


[installed  ] [2.5.6.SEC01 ] spring                   karaf-1.4.0

...


[installed  ] [1.2.0       ] spring-dm                karaf-1.4.0

...


[uninstalled] [1.4.0       ] wrapper                  karaf-1.4.0

...


[uninstalled] [1.4.0       ] obr                      karaf-1.4.0

...


[installed  ] [1.4.0       ] http                     karaf-1.4.0

...


[installed  ] [1.4.0       ] war                      karaf-1.4.0

...


[uninstalled] [1.4.0       ] webconsole               karaf-1.4.0

...


[installed  ] [1.4.0       ] ssh                      karaf-1.4.0

...


[installed  ] [1.4.0

...

       ] management               karaf-1.4.0

...


[installed  ] [1.0-SNAPSHOT] reportincident           repo-0

...


[installed  ] [1.0.0       ] transaction              repo-0

...


[installed  ] [4.0.0       ] connector                repo-0

...


[installed  ] [5.3.0       ] activemq                 repo-0

...


[installed  ] [5.3.0       ] activemq-camel           repo-0

...


[installed  ] [0.0.0       ] spring-web               repo-0

...


[installed  ] [0.0.0       ] hibernate                repo-0

...


[installed  ] [0.0.0       ] jdbc-driver              repo-0

...


[installed  ] [1.4.7       ] wicket                   repo-0

...


[uninstalled] [0.0.0       ] http-reportingincident   repo-0

...


Step 3 : Incident file

To test the Camel routing, we have to produce an incident file report and put it in the file defined in the from uri of your inittial route. Create a file containing csv lines :

Code Block

Code Block


h3. Step 3 : Incident file

To test the Camel routing, we have to produce an incident file report and put it in the file defined in the from uri of your inittial route. Create a file containing csv lines :

001,29-04-2009,Claus,Ibsen,incident camel-001,this is a report incident for camel-001,cibsen@gmail.com,+111 10 20 300

...


002,29-04-2009,Charles,Moulliard,incident smx-002,this is a report incident for smx-002,cmoulliard@gmail.com,+222 10 20 300

...


003,28-04-2009,Guillaume,Nodet,incident camel-123,this is a report incident for camel-123,gnodet@gmail.com,+333 10 20 300

...


004,25-04-2009,Gert,Vanthienen,incident camel-454,this is a report incident for camel-454,gvanthienen@gmail.com,+444 10 20 300

...


005,24-04-2009,James,Anstey,incident smx-023,this is a report incident for smx-023,janstey@gmail.com,+555 10 20 300

...


007,01-04-2009,Willem,Jiang,incident smx-456,this is a report incident for smx-456,wjiang@gmail.com,+666 10 20 300

...


008,27-04-2009,Matt,Raibble,incident appfuse-123,this is a report incident for appfuse-123,mraibble@gmail.com,+777 10 20 300

...


009,12-04-2009,Jean-Baptiste,Onofré,incident smx3-088,this is a report incident for smx3-088,cjbonofre@gmail.com,+888 10 20 300

...


010,17-04-2009,Hadrian,Zbarcea,incident camel-005,this is a report incident for camel-005,hzbarcea@gmail.com,+999 10 20 300

...

code



Save

...

your

...

file

...

and

...

copy

...

it

...

in

...

the

...

folder

...

Check

...

the

...

log

...

of

...

SMX

...

and

...

you

...

must

...

see

...

something

...

like

...

this

log_file_servicemix.txt

...

Next,

...

open

...

the

...

web

...

page

...

of

...

your

...

application

...

:

...

http://localhost:8080/reportincidentweb/

...

Image Added

Step 4 : Call a webservice

You can use the tool Soapui to call the web service of the application.

Use the following url from Soapui, to generate the client interface to communicate with the web service : http://localhost:8080/cxf/camel-example/incident?wsdl.

...

Call

...

the

...

web

...

service

...

with

...

the

...

request

...

:

...

http://localhost:8080/cxf/camel-example/incident

...


and

...

the

...

following

...

SOAP

...

message

...

request

...

by

...

example

...

:

Code Block
xml
xml


{code:xml}
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:rep="http://reportincident.example.camel.apache.org">
   <soapenv:Header/>
   <soapenv:Body>
      <rep:inputReportIncident>
         <incidentId>000</incidentId>
         <incidentDate>29-04-2009</incidentDate>
         <givenName>Charles</givenName>
         <familyName>Moulliard</familyName>
         <summary>This is an web service report incident</summary>
         <details>This is an web service report incident,This is an web service report incident.</details>
         <email>cmoulliard@gmail.com</email>
         <phone>+222 10 20 30 40</phone>
      </rep:inputReportIncident>
   </soapenv:Body>
</soapenv:Envelope>

...

log_file_servicemix2.txt

and web screen result : http://localhost:8080/reportincidentweb/Image Removed

Conclusion

Well, this tutorial was a little bit long but we have tried to provide you all the required information to design a real application using Apache Camel, Felix Karaf, OSGI, CXF and Apache Wicket frameworks. We hope that we have reached the goals defined in the introduction and will continue to improve its content based on Apache frameworks evolution. A part which is not covered but we plan to add it in the future concerns the testing/debugging of the application and transactional aspects.

#Resources

  • Attachments
    patterns.*part2.zip