Key Concepts
Endpoints and Addresses
Deployment Units
Mediation Support APIs
Error Handling
Interceptors
Configuration Externalization
Invoke an Asynchronous Flow
Usage of Message Files
UltraESB Clustering
Metrics and Alerting
Monitoring and Management
EMW Framework
https://www.adroitlogic.com
https://developer.adroitlogic.com
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
AdroitLogic UltraESB
1. THIS PRESENTATION AND THE INFORMATION IN IT ARE PROVIDED IN CONFIDENCE, AND MAY NOT BE DISCLOSED TO ANY THIRD PARTY OR USED FOR ANY OTHER PURPOSE
WITHOUT THE EXPRESS WRITTEN PERMISSION OF ADROITLOGIC LANKA PRIVATE LIMITED.
1
2. Topics
• Key Concepts
• Endpoints and Addresses
• Deployment Units
• Mediation Support APIs
• Error Handling
• Interceptors
• Configuration Externalization
• Invoke an Asynchronous Flow
• Usage of Message Files
• UltraESB Clustering
• Metrics and Alerting
• Monitoring and Management
• EMW Framework
2
3. Key Concepts
• Transport
- Provides several asynchronous and synchronous transports - almost all the well-known transport protocols
are supported
• Proxy Service
- Main unit of deployment
• Mediation Sequence
- Definition of actions to invoke during mediation
- Re-usable and similar to methods
• External Endpoint
- Defines an external service or endpoint and options to use when communicating with it
• Deployment unit
- An entity which facilitates user deployable artifacts such as proxy services, sequences and endpoints to be
grouped into a single entity
3
4. Topics
• Key Concepts
• Endpoints and Addresses
• Deployment Units
• Mediation Support APIs
• Error Handling
• Interceptors
• Configuration Externalization
• Invoke an Asynchronous Flow
• Usage of Message Files
• UltraESB Clustering
• Metrics and Alerting
• Monitoring and Management
• EMW Framework
4
5. Endpoints and Addresses
• Endpoint is a remote service endpoint to ESB which contains one or more
addresses
- Different address types
‣ URL - absolute URL of the endpoint
‣ Prefix - when the absolute destination for a message depends on some URL prefix + a trailing section of the
incoming URL. Mostly used while exposing REST services
‣ Response - used to send a response over the incoming message channel (e.g. HTTP)
‣ Echo - inject the message to the out sequence as a response message for the proxy service
‣ Default - used to send to dynamic endpoint addresses; for example if the destination address is picked up from
a database, registry or even another service etc.
• In-Destination and out-Destination
- Specify default endpoints for incoming and outgoing messages
• A sequence can route the message to a selected endpoint
5
6. Endpoints and Addresses - cont.
• Endpoints supports load balancing and failover
• Different types of endpoints
- Single Endpoints
- Round-Robin Endpoints without Fail-Over
- Round-Robin Endpoints with Fail-Over
- Fail-Over only Endpoint
- Weighted Endpoint without Fail-Over
- Weighted Endpoint with Fail-Over
- Random Endpoint without Fail-Over
- Random Endpoint with Fail-Over
6
8. • Using specific transport sender for endpoint address
- Transport sender for a given endpoint address will be selected based on the transport
protocol
- If there are multiple transport senders for a given protocol, one sender will be selected
randomly
- This selection can be configured by adding the sender id to the address value
<u:endpoint id="sender-1-ep">
<u:address>{http-sender-1}http://localhost:9000/service/SimpleStockQuoteService</u:address>
</u:endpoint>
<u:endpoint id="sender-2-ep">
<u:address>{http-sender-2}http://localhost:9000/service/SimpleStockQuoteService</u:address>
</u:endpoint>
Endpoints and Addresses - cont.
8
9. Topics
• Key Concepts
• Endpoints and Addresses
• Deployment Units
• Mediation Support APIs
• Error Handling
• Interceptors
• Configuration Externalization
• Invoke an Asynchronous Flow
• Usage of Message Files
• UltraESB Clustering
• Metrics and Alerting
• Monitoring and Management
• EMW Framework
9
10. Deployment Units
• Units of functionality which facilitate user deployable artifacts such as proxy services,
sequences, transports and endpoints to be grouped into a single entity
• Deployable either as,
- archives with .dua extension
- exploded deployment units with a directory structure
• Main configuration file is ultra-unit.xml
• Dynamically update/ deploy without downtime
- hot update for an existing DU without downtime for message processing
10
11. Deployment Units - Configuration and Class Scope
• Artifact configurations such as sequences and endpoints are locally
scoped within the deployment units.
- ensures a given deployment unit is self contained and can be easily updated/
reloaded
• Libraries or classes placed into the deployment units lib or classes
directory are also loaded at the local scope of the deployment unit
- allows one to use 2 different versions of the same library within 2 deployment units
11
12. Topics
• Key Concepts
• Endpoints and Addresses
• Deployment Units
• Mediation Support APIs
• Error Handling
• Interceptors
• Configuration Externalization
• Invoke an Asynchronous Flow
• Usage of Message Files
• UltraESB Clustering
• Metrics and Alerting
• Monitoring and Management
• EMW Framework
12
13. Mediation Support APIs
• UltraESB contains in-built mediation support APIs for utility functionalities
- XMLSupport - for DOM based mediation
- JSONSupport - for JSON based mediation
- HTTPSupport - HTTP/S transport related mediation support
- and MetricsSupport, JAXBSupport, EmailSupport, AlertSupport, etc.
• Support APIs can be accessed as,
mediation.getXMLSupport().extractAsStringUsingXPath()
• Custom support APIs can be written to expose a custom reusable utility
functionality
13
14. Topics
• Key Concepts
• Endpoints and Addresses
• Deployment Units
• Mediation Support APIs
• Error Handling
• Interceptors
• Configuration Externalization
• Invoke an Asynchronous Flow
• Usage of Message Files
• UltraESB Clustering
• Metrics and Alerting
• Monitoring and Management
• EMW Framework
14
15. Error Handling
• Handle errors as close as possible to its occurrence
• Best to use try-catch-finally and standard exception handling
- Feel free to define checked / runtime execptions specific to use cases
- Use a sequence error handler, only as a last resort for unhandled exceptions - when you
don’t have control to handle an exception with try-catch block
‣ handling asynchronous exceptions
try {
mediation.getXMLSupport().validate(msg, ...);
} catch (Exception e) {
if (logger.isTraceEnabled()) {
logger.trace("Format 2 failed schema validation : {}n{}",
e.getMessage(), mediation.readFullPayloadAsString(clone));
}
logger.error(FILTERING_VAL_ERROR, 'W', "Filtered XML failed schema validation for
Format 2 : {}", e.getMessage());
}
15
16. Topics
• Key Concepts
• Endpoints and Addresses
• Deployment Units
• Mediation Support APIs
• Error Handling
• Interceptors
• Configuration Externalization
• Invoke an Asynchronous Flow
• Usage of Message Files
• UltraESB Clustering
• Metrics and Alerting
• Monitoring and Management
• EMW Framework
16
17. Interceptors
• 3 Types of interceptors
- Message Interceptors
- Artifact Interceptors
- Server Interceptors
• Annotation driven, zero configuration
• Multiple levels of interceptions
• Synchronous
17
18. Topics
• Key Concepts
• Endpoints and Addresses
• Deployment Units
• Mediation Support APIs
• Error Handling
• Interceptors
• Configuration Externalization
• Invoke an Asynchronous Flow
• Usage of Message Files
• UltraESB Clustering
• Metrics and Alerting
• Monitoring and Management
• EMW Framework
18
19. Configuration Externalization
• Externalize configurable parameters to an external property file
• Secure parameter values with encryption
- Define string encryptor in ultra-root.xml file
- Define property placeholders in ultra-*.xml configuration files which have
externalized properties
19
20. Configuration Externalization - cont.
• In ultra-root.xml, string encryptor should be configured with the required encryption configuration
<bean name="stringEncryptor" class="org.jasypt.encryption.pbe.StandardPBEStringEncryptor">
<property name="config">
<bean class="org.jasypt.encryption.pbe.config.EnvironmentStringPBEConfig">
<property name="algorithm" value="PBEWITHSHA256AND256BITAES-CBC-BC"/>
<property name="passwordEnvName" value="APP_PASSWORD"/>
<property name="providerClassName" value="org.bouncycastle.jce.provider.BouncyCastleProvider"/>
<property name="providerName" value="BC"/>
</bean>
</property>
</bean>
• Add encryptable property placeholder configurer for encrypted properties in root level configuration files (ultra-root.xml, ultra-custom.xml
etc.)
<bean id="root-secure-property-configurer" class="org.adroitlogic.ultraesb.core.helper.EncryptablePropertyPlaceholderConfigurer">
<constructor-arg ref="stringEncryptor"/>
</bean>
• For deployment unit level encrypted properties, another property placeholder configurer should be defined either with the same or with
another string encryptor with a different encryption configuration
<bean id="du-secure-property-configurer" class="org.adroitlogic.ultraesb.core.helper.EncryptablePropertyPlaceholderConfigurer">
<constructor-arg ref="stringEncryptor"/>
</bean>
• In configuration files, parameters can be configured using generic spring placeholders syntax
<u:endpoint id="test-endpoint">
<u:address>${externalized.url}</u:address>
</u:endpoint>
20
21. Topics
• Key Concepts
• Endpoints and Addresses
• Deployment Units
• Mediation Support APIs
• Error Handling
• Interceptors
• Configuration Externalization
• Invoke an Asynchronous Flow
• Usage of Message Files
• UltraESB Clustering
• Metrics and Alerting
• Monitoring and Management
• EMW Framework
21
22. Invoke an Asynchronous Flow
• If there is a task to be executed in parallel to the main execution flow,
- define that task as a separate sequence
<u:sequence id="asynchronous-seq">
<u:class name="org.adroitlogic.testing.seq.AsynchronousTestSequence"/>
</u:sequence>
- invoke that sequence asynchronously at the main execution sequence - possibly
with a cloned message of the original message
mediation.invokeSequenceAsynchronously(clonedMsg, "asynchronous-seq");
22
23. Topics
• Key Concepts
• Endpoints and Addresses
• Deployment Units
• Mediation Support APIs
• Error Handling
• Interceptors
• Configuration Externalization
• Invoke an Asynchronous Flow
• Usage of Message Files
• UltraESB Clustering
• Metrics and Alerting
• Monitoring and Management
• EMW Framework
23
24. Usage of Message Files for Large Payload Manipulations
• Message file is a file acquired from the file cache - RAM disk based file
cache
- Memory mapped file created outside the heap
• Effectively handle large payloads without loading payload content to the
heap
- Fast access to the content since it’s a memory mapped file
- No GC overhead since it resides outside from the heap
- No file creation/ deletion overhead since it’s a cached file which is created at start
up
24
25. Usage of Message Files for Large Payload Manipulations
• Eg: when you want to prepare your response message with a large payload which should
be constructed by combining string values - possibly with a considerable size
Message responseMsg = msg.createDefaultResponseMessage();
MessageFile mf = mediation.resetPayloadToNewMessageFile(responseMsg);
BufferedWriter writer = Files.newBufferedWriter(mf.toPath(), StandardCharsets.UTF_8);
………
writer.write(“first portion of the payload”);
………
writer.write(“second portion of the payload”);
• Eg: when you want to copy payload to a new message,
Message clone = msg.cloneMessage();
MessageFile mf = mediation.resetPayloadToNewMessageFile(clone);
try (OutputStream out = mf.getOutputStream()) {
msg.getCurrentPayload().writeTo(out);
} catch (final IOException e) {
…………
}
25
26. Topics
• Key Concepts
• Endpoints and Addresses
• Deployment Units
• Mediation Support APIs
• Error Handling
• Interceptors
• Configuration Externalization
• Invoke an Asynchronous Flow
• Usage of Message Files
• UltraESB Clustering
• Metrics and Alerting
• Monitoring and Management
• EMW Framework
26
27. UltraESB Clustering
• UltraESB Clustering separates:
- Group Coordination & Cooperative Control
‣ Group of nodes operating seamlessly as a single unit
‣ Mechanism to control complete cluster as a single unit
- State replication
‣ By default nothing is shared between nodes in a cluster
‣ Any state shared is through Caching
• Cluster management
- ZooKeeper + JMX
- Connect to any node, control the cluster
- Cluster wide management commands
27
29. UltraESB Clustering
• UltraESB distribution includes ZK
- But can connect to an existing ZK quorum too
• There are no administration and worker nodes
- All nodes in a cluster are equal
• Active / Passive
- Depends on “pinned” services
‣ e.g. a SFTP polling service may be pinned to a node
- High Availability and Fail Over occurs for pinned services
29
30. UltraESB Clustering - Pinned Services
• Proxy services can be “pinned” to one or more nodes
• If such nodes go down or are missing in the cluster, the specified nodes
take over those services
• If the owner nodes re-appear later, the services shift back
• Useful for Active-Passive services where only one node must execute the
service at a given time
30
31. UltraESB Clustering - Fail-over
• Ability to failover and fail-back automatically
• Failover between nodes or node groups
• Several failover criteria
- On node count
- On node percentage
- On majority
31
32. Topics
• Key Concepts
• Endpoints and Addresses
• Deployment Units
• Mediation Support APIs
• Error Handling
• Interceptors
• Configuration Externalization
• Invoke an Asynchronous Flow
• Usage of Message Files
• UltraESB Clustering
• Metrics and Alerting
• Monitoring and Management
• EMW Framework
32
33. Metrics and Alerting
• By default metrics and statistics are collected and published to
Elasticsearch
• Can be configured to evict statistics to an external entity
• Alerts can be configured to be raised on collected metrics
• Metrics and statistics can be viewed via Monitor
33
34. Topics
• Key Concepts
• Endpoints and Addresses
• Deployment Units
• Mediation Support APIs
• Error Handling
• Interceptors
• Configuration Externalization
• Invoke an Asynchronous Flow
• Usage of Message Files
• UltraESB Clustering
• Metrics and Alerting
• Monitoring and Management
• EMW Framework
34
35. Monitoring and Management
• UltraESB can be monitored and managed via IMonitor
• iMonitor facilitates,
- complete control over cluster-wide or nodewise management
- visualization of collected metrics and statistics
- monitor system/ cluster health
- troubleshooting deployment issues
35
36. Topics
• Key Concepts
• Endpoints and Addresses
• Deployment Units
• Mediation Support APIs
• Error Handling
• Interceptors
• Configuration Externalization
• Invoke an Asynchronous Flow
• Usage of Message Files
• UltraESB Clustering
• Metrics and Alerting
• Monitoring and Management
• EMW Framework
36
37. EMW Framework
• Enterprise Middleware Framework (EMW)
- Framework for fast delivery of solutions based on UltraESB
‣ Pub-Sub style messaging
‣ Request-Response style messaging
- Guaranteed delivery
- At least once delivery
• Asynchronously persist the messages for tracing and provides message level
auditing
• Visualize persisted message information via IMonitor
• The amount of code that you have to write to implement a solution is made
minimal and provides a standard dashboard view
• A deployment that facilitates a complete solution
37