2. Agile Integration
● Lightweight
● Pattern Based
● Reusable Connectors
● Microservices Based
● Cloud native
solutions
● Lean artifacts,
individually
deployable
● Container based
scaling and high
availability
● Well defined,
re-usable, and well
managed
end-points
● Ecosystem
leverage
Flexibility Scalability Re-Usability
Distributed
Integration
3. DISTRIBUTED INTEGRATION - Microservice
microservice by
Red Hat JBoss Fuse
● Lightweight
○ Spring Boot deployment
○ DSL
○ S2i
● Pattern Based
○ Enterprise Integration Pattern
● Reusable Connector
○ Camel components
4. Building microservice with Fuse
RED HAT JBOSS FUSE
microservice
160+
Smart Endpoints
Twitter
FB
Salesforce
SaaS
Database
Msg
Broker
Kafka
….
XML
JSON
HL7
…...
HTTP
Netty
FTP
….
REST
API
Resource
Connector
….
5. Composing Microservice with Fuse
RED HAT JBOSS FUSE
microservice microservice microservice microservice
microservice
Enterprise
Integration
Patterns
6. Red Hat JBoss Fuse
APACHE CAMEL
SPRING-BOOT APACHE KARAF
CONTAINER
OPENSHIFT
JBOSS
DEVELOPER
STUDIO
Camel define routing
and mediation rules
based on Enterprise
Integration Pattern and
with 160+ built-in
components
7. 7
WHAT IS APACHE CAMEL?
Split
orders
Send
each order
to it’s
process service
Electronics
Others
Customer
Purchase
from("file:work/cbr/input")
.split(xpath("//orders"))
.choice()
.when(xpath("/order:order/order:type = 'E'"))
.to("activemq:queue:electronic/us")
.otherwise()
.recipientList(simple("http4://otherservice"));
15. 15
CAMEL ROUTE
Producer
● Produce requests
● End of route
● Dispatching outgoing
requests
Consumer
● Consume requests
● Start of a route
● Dispatching
outgoing replies
Processor
● Intermediate node in
the pipeline
● standard processors
or customized ones
17. CAMEL SPRING BOOT TESTING EXAMPLE
@RunWith(SpringRunner.class)
@ActiveProfiles("dev")
@SpringBootTest(webEnvironment = WebEnvironment.RANDOM_PORT)
public class ApplicationTest {
@Autowired
private TestRestTemplate restTemplate;
@Autowired
private CamelContext camelContext;
@Test
public void testProfile() {
ResponseEntity<Accounts> profileResponse
= restTemplate.getForEntity("/demos/account/profile/123456", Accounts.class);
assertThat(profileResponse.getStatusCode()).isEqualTo(HttpStatus.OK);
Accounts account = profileResponse.getBody();
assertThat(account.getAcctname()).isEqualTo("Simon C");
assertThat(account.getBalance()).isEqualTo(5000);
assertThat(account.getAddr()).isEqualTo("43 SLIVER EAGLE ST, RIVER");
}
}
18. INSERT DESIGNATOR, IF NEEDED18
CAMEL BLUEPRINT TESTING EXAMPLE
public class BlueprintCBRTest extends CamelBlueprintTestSupport {
@Produce(uri = "file:work/cbr/input")
protected ProducerTemplate inputEndpoint;
@EndpointInject(uri = "mock:outputUK")
protected MockEndpoint outputEndpointUK;
@Test
public void testCamelRoute() throws Exception {
// Create routes from the output endpoints to our mock endpoints so we
// can assert expectations
context.addRoutes(new RouteBuilder() {
@Override
public void configure() throws Exception {
from("file:work/cbr/output/uk").to(outputEndpointUK);
}
});
String value1 = getFileContents("src/test/resources/data/order1.xml");
outputEndpointUK.expectedMessageCount(2);
assertMockEndpointsSatisfied();
}
}
19. Building microservice with Fuse
RED HAT JBOSS FUSE
microservice
160+
Smart Endpoints
Twitter
FB
Salesforce
SaaS
Database
Msg
Broker
Kafka
….
XML
JSON
HL7
…...
HTTP
Netty
FTP
….
REST
API
Resource
Connector
….
20. Composing Microservice with FUSE
RED HAT JBOSS FUSE
microservice microservice microservice microservice
microservice
Enterprise
Integration
Patterns
21. INSERT DESIGNATOR, IF NEEDED21
MORE INFORMATION
● Camel in Action
● Apache Camel Developer’s
Cookbook
● Community website
○ http://camel.apache.org/
24. API
Multiple Device
Support
Device are not
limited to
screen
Voice enable
Drome, VR
Customer/
Vendor/
Partner
More complex
ecosystem
SaaS
Frequency
Data volume
Monetize
Service
Increased
revenue
market share
Open up new
opportunities
Modularize and
agility
Enhanced
developer
experience
Reuse code
Hide
implementation
details
Scalability in
Distributed
System
Able to flexibly
allocate
resource
Cloud enabled
25. Agile Integration
● Well defined, re-usable, and
well managed end-points
● Ecosystem leverage● Lightweight
● Pattern Based
● Reusable
Connectors
● Microservice Based
● Cloud native
solutions
● Lean artifacts,
individually
deployable
● Container based
scaling and high
availability
Re-UsabilityFlexibility Scalability
API
26. API FIRST
microservice by
RED HAT JBOSS FUSE
REST DSL
Swagger
API Doc
API
Data
Format Transform
microservice by
RED HAT JBOSS FUSE
API
microservice by
RED HAT JBOSS FUSE
Consume
Exposes
3ScaleAPImanagement
External clients
Community,
Partners,
Customers
27. INSERT DESIGNATOR, IF NEEDED27
CONVERTING BETWEEN DATA FORMAT
● Marshal
○ Java Bean → Textual format
● Unmarshal
○ Textual, Binary format → Java Bean
● Dozer
○ Fine-grained integration
■ mapping literal values
■ Use expressions
32. REST DSL
<camelContext xmlns="http://camel.apache.org/schema/spring">
<rest path="/say">
<get uri="/hello">
<to uri="direct:hello"/>
</get>
<get uri="/bye" consumes="application/json">
<to uri="direct:bye"/>
</get>
<post uri="/bye">
<to uri="mock:update"/>
</post>
</rest>
<route>
<from uri="direct:hello"/> …
</route>
<route>
<from uri="direct:bye"> …
</route>
</camelContext>
Verb
defining
http
method
Basepath
The service
path
Uri template
The service
method and
parameters
Consumes
Accept data format
setting
33. REST DSL
<restConfiguration bindingMode="auto" component="servlet" port="8080"/>
Message Body Direction Binding Mode Message Body
XML Incoming auto, xml, json_xml POJO
POJO Outgoing auto, xml, json_xml XML
JSON Incoming auto, xml, json_xml POJO
POJO Outgoing auto, xml, json_xml JSON
● camel-netty4-http
● camel-jetty
● camel-servlet
● camel-undertow
34. APPLYING API BEST PRACTICES
Simply but concrete naming for the URI.
Use HTTP Method for CRUD if possible:
● READ -> GET
● CREATE -> PUT
● UPDATE -> POST
● DELETE -> DELETE
● Globally recognized standard, easy consumable
<get uri="customer/{customerid}">
<to uri="direct:getCustomerinfo"/>
</get>
<get uri="product/{id}">
<to uri="direct:productInventory"/>
</get>
<get uri="account/profile/{acctid}">
<to uri="direct:getprofile"/>
</get>
35. APPLYING API BEST PRACTICES
Make the most out of HTTP Errors
Setting the right granularity of data and using the common data format
Clear automatic generated documentation
37. Circuit Breaker
<camelContext xmlns="http://camel.apache.org/schema/spring">
<route>
<from uri="direct:start"/>
<hystrix>
<to uri="http://fooservice.com/slow"/>
<onFallback>
<transform>
<constant>Fallback message</constant>
</transform>
</onFallback>
</hystrix>
<to uri="mock:result"/>
</route>
</camelContext>
JBoss Fuse
microservice
API
API
Service SaaS
Slow! No
response!
Timeout
Fallback
38. Continuous Improvement
Building APIs
● Native support
● Intuitive tooling
● Light weight
● Flexible service
and code re-use
from backend
Deploy APIs
● Flexibility to scale
● Load balancing
● zero downtime
● Security
Distributing APIs
● Authorization
● Clear documentation
● Enforce policies
● Community
Performance Analyst
● Number of Hits
● Average response time
● Revenue earned
Business alignment
● Change in market
● Government regulation
● New service launch
Versioning
● Retire
● Update
● New Service
● Internal service
re-creation
API
39. API FIRST
microservice by
RED HAT JBOSS FUSE
REST DSL
Swagger
API Doc
API
Data
Format Transform
microservice by
RED HAT JBOSS FUSE
API
microservice by
RED HAT JBOSS FUSE
Consume
Exposes
3ScaleAPImanagement
External clients
Community,
Partners,
Customers
42. Agile Integration
●
●
● Cloud native solutions
● Lean artifacts, individually
deployable
● Container based scaling
and high availability
● Lightweight
● Pattern Based
● Reusable
Connectors
● Community
Sourced
● Well defined,
re-usable, and well
managed
end-points
● Ecosystem
leverage
ScalabilityFlexibility Re-Usability
Container
43. OPENSHIFT
CONTAINER
Developer’s Local Env (laptop, desktop)
CDK
JBDS
VCS (Git)
Build
Run
Test
Jenkins
Nexus
(Library
Management)
Deployment Pipeline
Automatic Testing
Release management
Failure feedback
44. ● Speed, Size, Stability
● Sandboxed application processes on a shared
Linux OS kernel
● Simpler, lighter, and denser than virtual
machines
● Portable across different environments
● Speed, Choice, Sandbox
● Package my application and all of its
dependencies
● Deploy to any environment in seconds and
enable CI/CD
● Easily access and share containerized
components
Sys-Admins / Ops Developers
It Depends on Who You Ask
What Are Containers?
46. JBOSS EAP
JBOSS DATA GRID
JBOSS DATA
VIRTUALIZATION
JBOSS AM-Q
JBOSS BRMS
JBOSS BPM
JBOSS FUSE
RED HAT MOBILE
3 Scale
Container
Business
Automation
Container
Integration
Container
Data &
Storage
Container
Web &
Mobile
Traditional, Stateful, and Microservices-based Apps
OpenShift Application Lifecycle Management
(CI/CD)
Build Automation Deployment Automation
Service Catalog
(Language Runtimes, Middleware, Databases)
Self-Service
Infrastructure Automation & Cockpit
Networking Storage Registry
Logs &
Metrics
Security
Container Orchestration & Cluster Management
(kubernetes)
Container Runtime & Packaging
(Docker)
Enterprise Container Host
Red Hat Enterprise LinuxAtomic Host
47. OPENSHIFT TECHNICAL OVERVIEW47
OPENSHIFT ARCHITECTURE
EXISTING
AUTOMATION
TOOLSETS
SCM
(GIT)
CI/CD
SERVICE LAYER
ROUTING LAYER
PERSISTENT
STORAGE
REGISTRY
RHEL
NODE
c
RHEL
NODE
RHEL
NODE
RHEL
NODE
RHEL
NODE
RHEL
NODE
C
C
C C
C
C
C CC C
RED HAT
ENTERPRISE LINUX
MASTER
API/AUTHENTICATION
DATA STORE
SCHEDULER
HEALTH/SCALING
PHYSICAL VIRTUAL PRIVATE PUBLIC HYBRID
53. OPENSHIFT
POD
● A small group of tightly coupled
Containers
● Ensures collocation
● Docker containers share resources
within the pod
○ Volumes
○ Network / IP
○ Port space
○ CPU / Mem allocations
● Pod health probes
54. OPENSHIFT
PODS EXPOSE AS SERVICE
● Defines a group of Pods and how to access them
○ Labels and Selectors
● Decouple providers and accessors of services
● Don’t depend on Pod IPs directly
● Use a single IP that doesn’t change
● Virtual IP load balancing and discovery
POD
SERVICE
POD
10.0.1.1 10.0.1.2
CLIENT Name: amq
IP: 170.30.10.10
57. REPLICATION CONTROLLER
● Ensures that a specified number of Pod
replicas is running
● Holds Pod Templates for creating new
Pods
● Autoscaling
● Rolling Updates
63. OPENSHIFT
● Deployment strategy determines the deployment process for containers
● Rolling strategy
○ Performs rolling updates
○ Supports life-cycle hooks for injecting code into deployment process
○ Waits for pods to pass readiness check before scaling down old components
○ Used by default if no strategy specified on deployment configuration
● Recreate strategy
○ Has basic rollout behavior
○ Scales down previous deployment before deploying the new one
○ Supports life-cycle hooks for injecting code into deployment process
● Custom strategy for custom deployment behaviour
DEPLOYMENTS
64. OPENSHIFT
● Reducing downtime and risk associated with release
● Two identical environments in containing two
different releases (Blue and Green)
● After validating new release, can switch all traffic to
new version
● Quickly roll application back if you find issues
BLUE-GREEN DEPLOYMENT
router
65. OPENSHIFT
● A/B testing is a way of testing features in
application for various reasons like usability,
popularity, noticeability, etc
● Usually associated with application UI however
the back-end services need to be available
● Can implement with either application-level or
static switches
A/B DEPLOYMENT
66. OPENSHIFT
CONTAINER
Developer’s Local Env (laptop, desktop)
CDK
JBDS
VCS (Git)
Build
Run
Test
Jenkins
Nexus
(Library
Management)
Deployment Pipeline
Automatic Testing
Release management
Failure feedback
69. Take Control of Your APIs
Creating & Exposing APIs is just the start
Security &
Authentication
Version Control
Documentation
Policies
Access Control
Monitoring
Lifecycle
Management
Provisioning
Alerts
Metering & Billing
Testing
Portal
Scalability
Reliability
70. API Life-cycle
The API Lifecycle Management Approach
DEFINE: Identify the API services that deliver value to
the business layer
DEVELOP: Design, code, test, document standardize
templates
PUBLISH: Run security with defined policies and
controls
SUPPORT: Offer community, forums, documentation to
interact and collaborate
RETIRE: EOL, un-publish, communicate and remove
from market place following version control best
practice
71. 3scale API Management
RBDMS
SAP
NoSQL
WS
REST
JMS
+ more
FUSE INTEGRATION
SERVICE
JBoss Fuse
Service API
JBoss Fuse
Service API
JBoss Fuse
Service API
Developers
Partners
Mobile App
Affiliates
Internal Projects
+ more
API MANAGEMENT
Access control and
security
API contracts and
rate limits
Analytics and
reporting
Developer portal and
docs
Billing and payments
72. 3Scale API Management
Stack
Access control Security
API contracts Rate limits
Analytics Reporting
Dev portal Docs
Billing Payments
Admin Console
Dev Portal
API
Management
Traffic Manager
APIs
Applications
Consumers
HTTP / HTTPS
Security, usage &
rate limits
73. 3Scale API Management
Components - Flexible Distributed Control
Developers
Sync / Authorize
Mobile
Apps
Developer
Apps
Real Time
Admin Portal
Branded
Developer Portal
Swagger
Doc API Provider
Administrators
API ProvidersAPI GatewayAPI Consumers
API Manager
75. Deployment Options
Full SaaS: Hosted API Manager & API Gateways
Real Time Admin Portal
Sync / Authorize
API Provider
API Gateway API Manager
API Provider
Administrators
Mobile Apps Developer Apps
Branded Dev PortalSwagger Doc
API Consumers
Developers
76. Deployment Options
Hybrid: Hosted Manager - Self-managed Gateway
Real Time Admin Portal
Sync / Authorize
API Provider
API Gateway API Manager
API Provider
Administrators
Mobile Apps Developer Apps
Branded Dev PortalSwagger Doc
Developers
API Consumers
77. Deployment Options
Full On-Premise
Real Time Admin Portal
Sync / Authorize
API Provider
API Gateway
(Openshift)
API Manager
API Provider
Administrators
Mobile Apps Developer Apps
Branded Dev PortalSwagger Doc
API Consumers
Developers
78. Deployment Options
On-premise: Self-managed APIs
Real Time Admin Portal
Sync / Authorize
API Provider
API Gateway
(Openshift)
API Manager
API Provider
Administrators
Mobile Apps Developer Apps
Branded Dev PortalSwagger Doc
API Consumers
Developers
79. Deployment Options
On-premise: Self-managed APIs & External Self-managed Gateway
Real Time Admin Portal
Sync / Authorize
API Provider
API Gateway
(Native/Docker)
API Manager
API Provider
Administrators
Mobile Apps Developer Apps
Branded Dev PortalSwagger Doc
API Consumers
Developers
80. 3scale API Management
RBDMS
SAP
NoSQL
WS
REST
JMS
+ more
FUSE INTEGRATION
SERVICE
JBoss Fuse
Service API
JBoss Fuse
Service API
JBoss Fuse
Service API
Developers
Partners
Mobile App
Affiliates
Internal Projects
+ more
API MANAGEMENT
Access control and
security
API contracts and
rate limits
Analytics and
reporting
Developer portal and
docs
Billing and payments