Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Using Apache Camel connectors for external connectivity
1. PUBLIC PRESENTATION | CLAUS IBSEN1
Using Apache Camel connectors for
external connectivity
Claus Ibsen
Principal Software Engineer, Red Hat
May 2013
4. PUBLIC PRESENTATION | CLAUS IBSEN4
Your Speaker
● Principal Software Engineer at Red Hat
● Apache Camel
● 5 years working with Camel
● Author of Camel in Action book
● Contact
● EMail: cibsen@redhat.com
● Twitter: @davsclaus
● Blog: http://davsclaus.com
● Linkedin: http://www.linkedin.com/in/davsclaus
5. PUBLIC PRESENTATION | CLAUS IBSEN5
Agenda
● A little Example
● Understanding Components
● Essential Components
● Creating new Components
● Q and A
19. PUBLIC PRESENTATION | CLAUS IBSEN19
A Little Example
In fact we have 139 in latest release ...
davsclaus:~/Downloads/apache-camel-2.11.0/lib$ ls camel* | wc -l
139
21. PUBLIC PRESENTATION | CLAUS IBSEN21
A Little Example
● Summary
● Components for connectivity
● Camel routes with components and EIPs
● Components easy to configure
● A lot of components
● Very composeable
● Learn Once – Can use 'em All
22. PUBLIC PRESENTATION | CLAUS IBSEN22
Agenda
● A little Example
● Understanding Components
● Essential Components
● Creating new Components
● Q and A
23. PUBLIC PRESENTATION | CLAUS IBSEN23
Understanding Components
● Facilitate messaging for connectivity
24. PUBLIC PRESENTATION | CLAUS IBSEN24
Understanding Components
● Facilitate messaging for connectivity
Producer Consumer
25. PUBLIC PRESENTATION | CLAUS IBSEN25
Understanding Components
● … using endpoints via message channels
26. PUBLIC PRESENTATION | CLAUS IBSEN26
Understanding Components
● Component is a factory for creating endpoints
● … and endpoint factory for creating producer and/or
consumers
27. PUBLIC PRESENTATION | CLAUS IBSEN27
Understanding Components
● Component auto discovered
● ... or manually added to CamelContext
28. PUBLIC PRESENTATION | CLAUS IBSEN28
Understanding Components
● Endpoints can be configured using URIs
● … or for example using Java code
29. PUBLIC PRESENTATION | CLAUS IBSEN29
Understanding Components
● Revisit File Copier Example
30. PUBLIC PRESENTATION | CLAUS IBSEN30
Understanding Components
● Revisit File Copier Example
31. PUBLIC PRESENTATION | CLAUS IBSEN31
Understanding Components
● What is a Message in Camel?
32. PUBLIC PRESENTATION | CLAUS IBSEN32
Understanding Components
● … and contained in an Exchange during routing
http://camel.apache.org/using-getin-or-getout-methods-on-exchange.html
33. PUBLIC PRESENTATION | CLAUS IBSEN33
Agenda
● A little Example
● Understanding Components
● Essential Components
● Creating new Components
● Q and A
40. PUBLIC PRESENTATION | CLAUS IBSEN40
Essential Components
● File and FTP Components
● Exec Component
http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html
41. PUBLIC PRESENTATION | CLAUS IBSEN41
Essential Components
● ActiveMQ / JMS
Take time to read about JMS at:
http://camel.apache.org/jms
42. PUBLIC PRESENTATION | CLAUS IBSEN42
Essential Components
● ActiveMQ / JMS (cont.)
If using transactions with JMS
make sure to read about
cache levels at:
http://camel.apache.org/jms
http://camel.apache.org/activemq
43. PUBLIC PRESENTATION | CLAUS IBSEN43
Essential Components
● SQL
● … uri is SQL, and body is SQL parameters.
● Externalize queries in .properties file
http://camel.apache.org/sql-example.html
44. PUBLIC PRESENTATION | CLAUS IBSEN44
Essential Components
● JDBC
● … body is SQL and result is List<Map>
(eg like ResultSet)
Improvement on the way: https://issues.apache.org/jira/browse/CAMEL-6367
http://camel.apache.org/sql-example.html
45. PUBLIC PRESENTATION | CLAUS IBSEN45
Essential Components
● Other JDBC Components
● JPA
● Hibernate
● MyBatis
http://camel.apache.org/sql-example.html
47. PUBLIC PRESENTATION | CLAUS IBSEN47
Essential Components
● TCP/UDP Components
● Mina / Mina2
● Netty
http://camel.apache.org/sql-example.html
48. PUBLIC PRESENTATION | CLAUS IBSEN48
Agenda
● A little Example
● Understanding Components
● Essential Components
● Creating new Components
● Q and A
52. PUBLIC PRESENTATION | CLAUS IBSEN52
Creating new Camel Components
1. execute this maven command
2. type camel to filter only Camel archetypes
3. type number to select “camel-archetype-component” (in this ex its 5)3. type number to select “camel-archetype-component” (in this ex its 5)
4. select the Camel version to use
Geocoder = Java component name
(must be first letter in upper case)
geocoder = Camel component name
(must be lower-case)
53. PUBLIC PRESENTATION | CLAUS IBSEN53
Creating new Camel Components
●
Add 3rd
party library to pom.xml file
54. PUBLIC PRESENTATION | CLAUS IBSEN54
Creating new Camel Components
● Auto discover component
file in META-INF classpath
55. PUBLIC PRESENTATION | CLAUS IBSEN55
Creating new Camel Components
Options as getter/setter
Consumer is not supported
58. PUBLIC PRESENTATION | CLAUS IBSEN58
Creating new Camel Components
● Running unit test ...
59. PUBLIC PRESENTATION | CLAUS IBSEN59
Agenda
● A little Example
● Understanding Components
● Essential Components
● Creating new Components
● Q and A
60. PUBLIC PRESENTATION | CLAUS IBSEN60
Where do I get more information?
● Where can I get the slides?
http://www.slideshare.net/davsclaus
61. PUBLIC PRESENTATION | CLAUS IBSEN61
Where do I get more information?
● CamelOne 2013 Conference
http://www.camelone.com
62. PUBLIC PRESENTATION | CLAUS IBSEN62
Where do I get more information?
● Getting started with Apache Camel Webinar
● http://fusesource.com
Click on webinars menu
Building superior …
63. PUBLIC PRESENTATION | CLAUS IBSEN63
Where do I get more information?
● Best Article covering what Apache Camel is
● http://java.dzone.com/articles/open-source-integration-
apache
Link to article from “Getting Started”
64. PUBLIC PRESENTATION | CLAUS IBSEN64
Where do I get more information?
● Camel Essential Components Reference Card
http://refcardz.dzone.com/refcardz/essential-camel-components
65. PUBLIC PRESENTATION | CLAUS IBSEN65
Where do I get more information?
● Buy the Camel in Action book
http://manning.com/ibsen/
Use code ...
camel40
… for 40% discount