We are entering a new era of microservices and containers which is reshaping how enterprise IT is delivering services with a focus on agility. As a result, developing, integrating, and connecting smaller discrete services has become more complex. Application programming interfaces (APIs) are increasingly being used to unlock core systems, collaborate with partners and reach customers in new ways. A platform architectural approach provides a foundation to deliver innovative solutions across today's hybrid environments.
Join Red Hat for a no-cost, 1-day, hands-on technical workshop. Take a journey to agile integration by taking back more control of your applications.
2. Agenda
8:30 AM – 9:00 AM
INTRODUCTION & SETTLE IN
9:00 AM – 10:00 AM
AGILE INTEGRATION JOURNEY
10:00 AM – 10:30 AM
INTEGRATION DEMO
10:30 AM – 10:45 AM
BREAK
10:45 AM – 12:00 AM
DISTRIBUTED INTEGRATION AND MICROSERVICE
12:00 AM – 1:00 PM
LUNCH
3. Agenda
1:00 PM – 2:00 PM
API FIRST
2:15 PM – 3:30 PM
CONTAINER
2:00 PM – 2:15 PM
BREAK
4:45 PM – 5:15 PM
SUMMARY / Q & A
3:30 PM – 4:45 PM
API Management
13. INSERT DESIGNATOR, IF NEEDED13
● Stringent scalability
● Slow team co-ordination
● Complex service registry
● Long software delivery cycle
SOA AND ESB
31. AGILE INTEGRATION
Cloud native solutions
Lean artifacts,
individually deployable
Container based scaling
and high availability
● Lightweight
● Pattern Based
● Reusable
Connectors
● Microservice 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
32. AGILE INTEGRATION
Cloud native solutions
Lean artifacts,
individually deployable
Container based scaling
and high availability
Flexibility Scalability Re-Usability
FUSE FUSE
3SCALE
OPENSHIFT
KUBERNETES
DOCKER
FABRIC8
APACHE KARAF
SPRING BOOT
33. AGILE INTEGRATION
Container Container Container
Container
Client
APIManagement
RESTFul API RESTFul APIAMQP
RESTFul API
RESTFul
API
ClientClient
API
API
API
Mgmt
34. MUST READ !
Download your copy:
https://developers.redhat.com/promotions/microservi
ces-for-java-developers/
@christianposta
36. 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
37. DISTRIBUTED INTEGRATION - Microservice
microservice by
Red Hat JBoss Fuse
● Lightweight
○ Spring Boot deployment
○ DSL
○ S2i
● Pattern Base
○ Enterprise Integration Pattern
● Reusable Connector
○ Camel components
38. Building microservice with Fuse
RED HAT JBOSS FUSE
microservice
160+
Endpoint Components
Database
Msg
Broker
….
XML
JSON
HL7
…...
HTTP
Netty
FTP
….
REST
API
Resource
Connector
Twitter
FB
Salesforce
SaaS
….
39. Building microservice with Fuse
RED HAT JBOSS FUSE
microservice
160+
Endpoint Components
Database
Msg
Broker
….
XML
JSON
HL7
…...
HTTP
Netty
FTP
….
REST
API
Resource
Connector
Twitter
FB
Salesforce
SaaS
….
40. Composing Microservice with Fuse
RED HAT JBOSS FUSE
microservice microservice microservice microservice
microservice
Enterprise
Integration
Patterns
41. 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
42. INSERT DESIGNATOR, IF NEEDED42
PATTERN BASED
Split
orders
Send
each order
to it’s
process service
Electronics
Others
Aggregator
Normalizer
Content Enricher
Resequencer
43. INSERT DESIGNATOR, IF NEEDED43
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"));
50. INSERT DESIGNATOR, IF NEEDED50
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
51. CAMEL EXCHANGE in ROUTE
PROCESSOR PROCESSOR PROCESSOR
PRODUCER
Exchange
Exchange
In In In
In
Out Out Out
Out
52. RUNNING CAMEL
Spring Boot Karaf
Spring DSL/Java
Spring Boot Starter module
Fat JARs
Stand-alone App
Embedded dependency
Pre-configured, pre-sugared
Small and lightweight
Blueprint DSL/Java
Blueprint module
Bundles
Modularized
Explicit dependency
Versioned
Hot redeploy
53. Container
Fuse and Spring Boot
Application
Camel Spring Boot Starter
Camel route
Configurations
Auto-wires components
Tomcat, Undertow
JDBC
Messaging
(application.properties/yml)
Auto-detects
routes
Auto-configure
Camelcontext, register
Camel utilities
54. TESTING
Spring Boot Karaf
@RunWith(SpringRunner.class)
@SpringBootTest annotation
Autowire CamelContext
Extends CamelBlueprintTestSupport
camel-test-blueprint
Specify Camel blueprint descriptor
location
ASSERT
● # of messages are received on each endpoint,
● Payloads are received in the right order,
● Messages arrive match some kind of Predicate
56. 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");
}
}
57. INSERT DESIGNATOR, IF NEEDED57
MORE INFORMATION
● Camel in Action
● Apache Camel Developer’s
Cookbook
● Community website
○ http://camel.apache.org/
61. 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
62. 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
64. 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>
65. 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
66. 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
67. 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
75. 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
76. 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
77. SWAGGER
<restConfiguration apiContextPath="api-docs" bindingMode="json"
component="servlet" contextPath="/demos">
<apiProperty key="cors" value="true"/>
<apiProperty key="api.title" value="API for demo"/>
<apiProperty key="api.version" value="1.0.0"/>
</restConfiguration>
<get uri="/{id}" outType="com.redhat.User">
<description>Find user by id</description>
<param name="id" type="path" description="The id of the user to get" dataType="int"/>
<to uri="bean:userService?method=getUser(${header.id})"/>
</get
84. OPENSHIFT
CONTAINERS
● Containerized application run in Pods
● Pods exposed as a Service
● Edge router http://myapp.com
○ Integration API endpoints (JBoss pods)
○ database (MySQL pods with persistent storage)
○ Messaging (TBD...)
86. OPENSHIFT
PODS
● 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
88. OPENSHIFT
PODS EXPOSED 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
92. REPLICATION CONTROLLER
● Ensures that a specified number of Pod
replicas is running
● Holds Pod Templates for creating new
Pods
● Autoscaling
● Rolling Updates
98. 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
99. 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
100. 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
101. 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
104. 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
Developer Portal
Scalability
Reliability
105. 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
106. 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
107. 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
109. 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
110. 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
111. 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
112. 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
113. 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
114. Native
apicast-gateway code from
upstream repo running on:
Openresty (NGINX + LUA)
for Red Hat Enterprise Linux
Docker
apicast-gateway
Docker Image
from Red Hat Registry
Openshift
Openshift API Gateway
Template (which will pull in
apicast-gateway Docker
Image)
Inside or Outside the same
API manager Cluster
Self-managed API Gateway
Deployment Options