Chapter 1. The world of open source ESBs
Listing 1.1. The file poller Mule configuration: mule-config.xml
Listing 1.2. The file poller ServiceMix configuration: servicemix.xml
Chapter 2. Architecture of Mule and ServiceMix
Listing 2.1. Transformers configuration in Mule
Listing 2.2. Sample inbound router definition for Mule
Listing 2.3. Configuration showing how to use an outbound router
Listing 2.4. Example of a simple component with Java implementation
Listing 2.5. Sample XBean configuration for the ServiceMix file BC
Listing 2.6. Content-based routing using the EIP service engine
Chapter 3. Setting up the Mule and ServiceMix environments
Listing 3.1. CustomerServiceImpl bean that will be configured with Spring
Listing 3.2. CustomerDAO that will be injected into the CustomerBean
Listing 3.3. Spring dependency injection example
Listing 3.4. Using Spring together with Mule: an example service
Listing 3.5. Mule component referencing a Spring bean
Listing 3.6. ServiceMix configuration that references a POJO bean defined in Spring
Listing 3.7. JiBX mapping file of the person XML message to a Person Java class
Listing 3.8. JiBX mapping example with a structure definition
Listing 3.9. An example of a JiBX binding file with namespaces
Listing 3.10. Implementation of the ObjectToXML transformer for Mule
Listing 3.11. Implementation of the XMLToObject transformer for Mule
Listing 3.12. The servicemix-bean implementation, using the JiBX framework
Listing 3.13. JiBXUtil class showing how to unmarshal and marshal XML messages
Listing 3.14. ActiveMQ configuration using a PostgreSQL database for persistency
Listing 3.15. Definition of an ActiveMQ connection in a Mule configuration
Listing 3.16. Defining an ActiveMQ connection in a servicemix-jms configuration
Listing 3.17. Mule configuration with an ActiveMQ and transformer definition
Listing 3.18. Mule service definition forming a bridge between a file and a JMS endpoint
Listing 3.19. Mule service that bridges from a JMS queue to a JMS topic
Listing 3.20. Two Mule services listening on a JMS topic and logging to the file system
Listing 3.21. Bean implementation that defines transformation and routing logic
Listing 3.22. JiBX mapping illustrating how to map between XML and Java
Listing 3.23. ServiceMix JMS configuration
Listing 3.24. File endpoints configuration for the ServiceMix example
Chapter 4. The foundation of an integration solution
Listing 4.1. Simple logging implementation
Listing 4.2. The command-line Mule configuration: mule-config.xml
Listing 4.3. Implementation of the StringToInteger transformer
Listing 4.4. Mule configuration for the simple logging example with a transformer
Listing 4.5. Java interface and class that return a response to a given user input
Listing 4.6. Component implementation using ResponseOptions
Listing 4.7. Mule configuration of the Spring example
Listing 4.8. A simple logging example with the servicemix-bean service engine
Listing 4.9. ServiceMix configuration for the simple-jms-su service unit
Listing 4.10. ServiceMix configuration for the simple-bean-su service unit
Listing 4.11. ServiceMix component that uses Spring’s dependency injection
Listing 4.12. ServiceMix configuration that uses a Spring bean
Listing 4.13. Outbound routing configuration of the message logger service
Listing 4.14. Mule configuration for the cheapest price calculator
Listing 4.15. Implementation of a custom aggregator, the BookQuoteAggregator
Listing 4.16. Implementation of CheapestPriceCalculator
Listing 4.17. ServiceMix configuration for the static recipient list
Listing 4.18. Pipeline configuration for the in-out invocation of the Saxon component
Listing 4.19. Saxon XSLT configuration
Listing 4.20. AggregatorMessageLogger implementation
Listing 4.21. Pipeline configuration for the message logger
Listing 4.22. ServiceMix aggregator configuration
Listing 4.23. Implementation of the CheapestPriceCalculator bean
Listing 4.24. Spring Integration Implementation of HelloRouter
Listing 4.25. The XML configuration for the Spring Integration hello example
Chapter 5. Working with messages
Listing 5.1. Service configuration of a fixed router implemented in Mule
Listing 5.2. Content-based router configuration with servicemix-eip
Listing 5.3. Content-based router XML configuration with servicemix-camel
Listing 5.4. Content-based router Java DSL configuration with servicemix-camel
Listing 5.5. Mule content-based router implementation
Listing 5.6. The content-based routing example implemented with Apache Synapse
Listing 5.7. Mule validation configuration
Listing 5.8. Custom inbound router with XSD validation
Listing 5.9. servicemix.xml of the validation component in the lightweight container
Listing 5.10. Java implementation of the ErrorHandlerComponent
Listing 5.11. Message validation example with Apache Synapse
Listing 5.12. Mule configuration that calls the weather web service
Listing 5.13. The message transformation service in the Mule configuration
Listing 5.14. Configuration of a JMS consumer with a reply destination
Listing 5.15. Weather web service invocation configuration for ServiceMix
Listing 5.16. Implementation of the Camel converter component
Chapter 6. Connectivity options
Listing 6.1. Mule File transport using a file filter and output pattern
Listing 6.2. Mule File transport using a backup directory
Listing 6.3. servicemix-file binding component using a filename marshaler
Listing 6.4. ServiceMix file poller that implements a custom file filter
Listing 6.5. Filter implementation that checks the beginning of a filename
Listing 6.6. File sender configuration showing how to send binary files
Listing 6.7. A Mule service that consumes and produces a JMS message
Listing 6.8. A Mule service that sends the incoming message to a JMS topic
Listing 6.9. A Mule service that subscribes to a JMS topic
Listing 6.10. ServiceMix JMS configuration for a queue-based scenario
Listing 6.11. ServiceMix configuration showing how to write to a topic
Listing 6.12. ServiceMix configuration showing how to read from a topic
Listing 6.13. Mule JDBC configuration for querying and updating a database table
Listing 6.14. Mule service showing how to query a database table
Listing 6.15. Mule JDBC connector definition to insert data into a database
Listing 6.16. Mule service showing how to write to a database
Listing 6.17. Adding a JDBC datasource to the JNDI registry
Listing 6.18. Database mapping that maps the columns to an XML Schema
Listing 6.19. WSDL configuration for JDBC component: import section
Listing 6.20. WSDL configuration for JDBC component: message section
Listing 6.21. WSDL configuration for JDBC component: portType section
Listing 6.22. WSDL configuration for JDBC component: binding section
Listing 6.23. WSDL configuration for JDBC component: service section
Listing 6.24. JBI services configuration for the services described in the WSDL
Listing 6.25. File poller and sender configuration for the JDBC example
Listing 6.26. Mule services configuration that sends mail using SMTP
Listing 6.27. Mule service configuration that receives emails using POP3
Listing 6.28. File poller configuration that sends the message to the mail service
Listing 6.29. Configuration for sending emails using the PEtALS Mail binding component
Listing 6.30. PEtALS configuration for the Mail component to receive emails
Listing 6.31. Mule configuration that sends file messages to an FTP server
Listing 6.32. Mule configuration that reads data from a FTP server
Listing 6.33. FTP binding component for ServiceMix with poller functionality
Listing 6.34. FTP sender configuration for ServiceMix
Listing 6.35. PersonService interface that defines the method of our EJB
Listing 6.36. Person and SearchQuery objects used by the PersonService
Listing 6.37. EJB3 implementation of the PersonService interface
Listing 6.38. Mule configuration showing how to connect Mule to an EJB server
Listing 6.39. Transformer that transforms a string to a SearchQuery object
Listing 6.40. ServiceMix configuration that exposes EJBs as services to the NMR
Listing 6.41. A file sender and file poller configuration for the EJB example
Listing 6.42. Pipeline configuration to connect the file endpoints to the EJB service
Chapter 7. Web services support
Listing 7.1. XML Schema definition part of the WSDL file
Listing 7.2. Wrapped element used for the findCompanies operation
Listing 7.3. WSDL message and operations definition
Listing 7.4. WSDL part showing the binding implementation of the port type
Listing 7.5. WSDL part showing the service location related to a binding definition
Listing 7.6. Domain objects by the company web service Java implementation
Listing 7.7. Implementation of the CompanyService interface
Listing 7.8. The generated stub with code to connect to our own implementation
Listing 7.9. Mule configuration that shows how Mule can host a top-down web service
Listing 7.10. CXF binding component configuration that publishes a web service
Listing 7.11. CXF service engine configuration, which calls a POJO class
Listing 7.12. JAX-WS annotations for the generated web services stub
Listing 7.13. Mule configuration for providing a bottom-up web service
Listing 7.14. ServiceMix configuration for providing a bottom-up web service
Listing 7.15. ServiceMix configuration for providing a web service externally
Listing 7.16. Consuming web services using the CXF transport in Mule
Listing 7.17. Calling web services using the CXF binding component in ServiceMix
Listing 7.18. File configuration for reading from and writing files to the file system
Listing 7.19. EIP configuration that invokes the CXF service definition
Listing 7.20. Using Mule together with WS-Security for calling a secured web service
Listing 7.21. CXF configuration for securing outgoing web service calls
Listing 7.22. Using Mule and WS-Security to provide security to incoming messages
Listing 7.23. CXF configuration for securing incoming web service calls
Listing 7.24. Consuming web services using the CXF binding component
Listing 7.25. Consuming a web service that’s secured using WS-Security
Listing 7.26. Providing a web service that’s secured using WS-Security
Listing 7.27. WS-Addressing–enabled inbound endpoint for Mule using CXF
Listing 7.28. Mule transformer that accesses the WS-Addressing headers
Chapter 8. Implementing enterprise-quality message flows
Listing 8.1. Configuring a dead letter queue
Listing 8.2. Configuring a custom connector exception strategy in Mule
Listing 8.3. Camel routing configuration with a custom dead letter channel
Listing 8.4. Part 1 of the simple authentication example showing the Acegi beans
Listing 8.5. Part 2 of the simple authentication example showing the message flow
Listing 8.6. Part 1 of the LDAP authentication example containing the LDAP integration
Listing 8.7. Part 2 of the LDAP authentication example: the message flow definition
Listing 8.8. Part 1 of the LDAP authentication example with an authorization rule
Listing 8.9. Part 2 of the LDAP authentication example with an authorization rule
Listing 8.10. HTTP endpoint configuration with authentication enabled
Listing 8.11. Bean component that logs the security context and the message content
Listing 8.12. Mule configuration with a JMS transaction definition
Listing 8.13. Part 1 of the transactional message flow with the JMS and bean endpoints
Listing 8.14. Part 2 of the transactional message flow with the connection definition
Listing 8.15. Part 3 of the transactional message flow with ActiveMQ broker definition
Chapter 9. Implementing a case study using patterns
Listing 9.1. Stub implementation for a restaurant endpoint
Listing 9.2. DAO to retrieve and store reservations; implemented with Hibernate
Listing 9.3. Topic subscriber that invokes the restaurant bean
Listing 9.4. Expiration bean that stores the reservation message
Listing 9.5. Mule definition of the confirmation-message routing functionality
Listing 9.6. Filter implementation validating the confirmation message
Listing 9.7. JMS endpoint configuration that listens for messages
Listing 9.8. ReplyToConsumerMarshaler class implementation
Listing 9.9. Camel service engine with a router implementation
Listing 9.10. ExpirationProcessor implementation, adding a correlation identifier
Listing 9.11. JSR-181 endpoint to wrap the restaurant Spring bean
Listing 9.12. Expiration Camel filter and content-based router implementation
Listing 9.13. Camel processor, validating the confirmation message
Listing 9.14. JMS consumers and providers for the expiration flow
Chapter 10. Managing and monitoring the ESB
Listing 10.1. Sample wire-tap configuration in Mule
Listing 10.2. Mule restaurant service extended with the Wire Tap pattern
Listing 10.3. ServiceMix configuration for the Wire Tap pattern
Listing 10.4. ServiceMix wire-tap implementation in the EIP service unit
Listing 10.5. Modified JMS consumer that calls the wire-tap service
Listing 10.6. Mule configuration, implementing the Message Store pattern
Listing 10.7. Auditor implementation that stores messages in a database
Listing 10.8. Mule configuration that implements the Detour pattern
Listing 10.9. Mule configuration for the Detour pattern
Listing 10.10. DetourFilter that can be enabled and disabled using JMX
Listing 10.11. Spring configuration exposing the detour filter to JMX
Listing 10.12. ServiceMix EIP SE configuration that implements the Detour pattern
Listing 10.13. ServiceMix detour filter implemented as a ServiceMix predicate
Listing 10.14. Modified JMS consumer that calls the wire-tap service
Listing 10.15. ServiceMix bean SU configuration to deal with the Detour pattern
Chapter 11. Implementing a process engine in the ESB
Listing 11.1. Scuba diving request and booking JiBX mappings
Listing 11.2. The common diving agency service interface implementation
Listing 11.3. Spring configuration for the diving agencies
Listing 11.4. Hello world implementation with jPDL
Listing 11.5. jBPM HelloWorldHandler implementation
Listing 11.6. Definition of the jBPM transport in a Mule configuration file
Listing 11.7. Snippet of the scuba diving process using action handlers
Listing 11.8. DivingAgencyHandler implementation that sets the request message
Listing 11.9. Configuration to integrate Apache Ode with ServiceMix
Appendix B. Differences between Mule 1.4.x and Mule 2.0.x
Listing B.1. Mule 1.4.x-based empty configuration file
Listing B.2. Mule 2.0.x-based empty configuration file
18.191.139.42