These are the slides that were presented at Red Hat's workshop: Achieving True Integration Agility with Containers, Microservices and APIs. Seattle, WA, October 26, 2017
2. Red Hat Team
Tony Aguirre Middleware & Container Sales Specialist
(Seattle, WA)
taguirre@redhat.com
Ganesh Radhakrishnan MW Solution Architect (Seattle, WA) ganesh@redhat.com
Josh Reagan MW Integration Architect, Tiger Team
SME (Denver, CO)
jreagan@redhat.com
Hugo Guerrero APIs & Integration Technology Evangelist
(Mexico City, MX)
hguerrero@redhat.com
Chad Holmes MW Integration Architect, Tiger Team
SME (Boston, MA)
cholmes@redhat.com
3. Agenda
8:30 AM – 9:00 AM
INTRODUCTION & SETTLE IN
9:00 AM – 10:30 AM
AGILE INTEGRATION JOURNEY
DISTRIBUTED INTEGRATION AND MICROSERVICES
10:45 AM – 12:00 PM
INTEGRATION AND MICROSERVICES LAB
10:30 AM – 10:45 AM
BREAK
12:00 PM – 1:00 PM
LUNCH
1:00 PM – 2:00 PM
CONTAINERS AND API MANAGEMENT
2:15 PM – 4:45 PM
CONTAINERS AND API MANAGEMENT LAB
4:45 PM – 5:00 PM
SUMMARY / Q & A
19. 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
Container API
20. DISTRIBUTED INTEGRATION - Microservice
microservice by
Red Hat JBoss Fuse
● Lightweight
○ Spring Boot deployment
○ DSL
○ S2i
● Pattern Base
○ Enterprise Integration Pattern
● Reusable Connector
○ Camel components
21. 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
….
22. Composing Microservice with Fuse
RED HAT JBOSS FUSE
microservice microservice microservice microservice
microservice
Enterprise
Integration
Patterns
23. 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
24. INSERT DESIGNATOR, IF NEEDED24
PATTERN BASED
Split
orders
Send
each order
to it’s
process service
Electronics
Others
Aggregator
Normalizer
Content Enricher
Resequencer
25. INSERT DESIGNATOR, IF NEEDED25
CAMEL DSL
JBOSS
DEVELOPER
STUDIO
Java DSL
Blueprint DSL (XML)
Spring DSL (XML)
26. INSERT DESIGNATOR, IF NEEDED26
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"));
32. INSERT DESIGNATOR, IF NEEDED32
CAMEL CONTEXT
Camel ContextCamel
runtime
environment
Route Route Route
Registry
Endpoint
Endpoint
EndpointEndpoint
Endpoint
Endpoint
Endpoint
Message
source or sink
Place to register
and plug
Javabeans,
components or
endpoints, for
later lookup.
Definition of
message
flowing rules
Components
Components are built-in sets
of highly configurable
libraries, that represents as
the plug-in factories for the
endpoints
33. INSERT DESIGNATOR, IF NEEDED33
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
34. CAMEL EXCHANGE in ROUTE
PROCESSOR PROCESSOR PROCESSOR
PRODUCER
Exchange
Exchange
In In In
In
Out Out Out
Out
39. 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
41. 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");
}
}
42. INSERT DESIGNATOR, IF NEEDED42
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();
}
}
43. 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
….
44. Composing Microservice with FUSE
RED HAT JBOSS FUSE
microservice microservice microservice microservice
microservice
Enterprise
Integration
Patterns
45. INSERT DESIGNATOR, IF NEEDED45
MORE INFORMATION
● Camel in Action
● Apache Camel Developer’s
Cookbook
● Community website
○ http://camel.apache.org/
48. API FIRST
FOR Speaker ONLY
Data Transformation
REST DSL
API Best Practice
Swagger docs
49. 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
50. 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
Distributed
Integration
Container
51. 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
52. INSERT DESIGNATOR, IF NEEDED52
CONVERTING BETWEEN DATA FORMAT
● Marshal
○ Java Bean → Textual format
● Unmarshal
○ Textual, Binary format → Java Bean
● Dozer
○ Fine-grained integration
■ mapping literal values
■ Use expressions
53. INSERT DESIGNATOR, IF NEEDED53
DIFFERENT DATA FORMAT
bindy protobuf
castor serialization
csv soap
crypto syslog
dozer tidy markup
flatpack xml beans
gzip xml security
hl7 xstream
jaxb zip
json
58. 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
59. 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
60. APPLYING API BEST PRACTICES
Simple 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>
61. 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
62. 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
64. 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
65. 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
66. 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
67. URLS to access LABS
https://github.com/jbossdemocentral/fuse-introlab
Password is r3dh4t1!
69. 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
Distributed
Integration
API
70. ● Sandboxed application processes on a
shared Linux OS kernel
● Simpler, lighter, and denser than virtual
machines
● Portable across different environments
● 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?
71. ● Enable efficiency and automation for
microservices, but also support
traditional applications
● Enable faster and more consistent
deployments from Development to
Production
● Enable application portability across
4 infrastructure footprints: Physical,
Virtual, Private & Public Cloud
Containers - An Evolution in Application Deployment
74. REPLICATION CONTROLLER
● Ensures that a specified number of Pod
replicas is running
● Holds Pod Templates for creating new
Pods
● Autoscaling
● Rolling Updates
82. 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
83. 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
84. Modular
No single point of failure
Hybrid cloud access
Highly scalable
Red Hat 3scale API Management
Flexible Distributed Control
85. Red Hat 3Scale AMP85
Security & Access Control
How do you manage who gets access to your API? Can you establish different
levels of access for different types of users? Can you control how different
applications interact with your API?
Access control features are essential to making sure you determine exactly
who uses your API, how it is used and how much they can use it. We make it
easy to centrally set up and manage policy and application plans for all your
APIs on one platform
It goes without saying that if you’re planning to open an API,
security needs to be carefully considered from the start. Whether
your API is public, private or internal, with 3scale you can choose
the authentication type most appropriate to your needs. We offer
a range of authentication patterns and credentials to choose from,
including unique API keys, and OAuth tokens.
86. Red Hat 3Scale AMP86
Your API Security
Multiple authentication mechanisms
Can be combined with IP / Domain referrer whitelisting
Authenticate traffic
Restrict by policy
Drop unwelcome calls
Protect backend services
Generate overage alerts
Impose rate limits
– API Key – App ID / App Key – OAuth 2.0
Authenticate and restrict access to your APIs. Protect backend services.
87. Allow/restrict access
to your API endpoints
along with rate limits
- Endpoint A
- Endpoint t B
- X Calls / Minute
- Y Calls / Day
- Free
- $X per Month
- $Y per Call
Package #1
Package #2
Package #3 Developers
Internal
Teams
Strategic
Partners
API services
Rate limits
Monetization
API Contracts, Throttling & Rate Limits
Package your APIs. Crete access tiers. Set rate limits.
88. Red Hat 3Scale AMP88
Reports & Analytics
Track and monitor usage. Get reports by API, app, method and metric.
Gain and share API program insights.
Monitor and set alerts on traffic flow. Provide partners and
developers with reports on their traffic with a user dashboard
designed for them. Analyze your API traffic through detailed traffic
analytics by account, application or service and share performance
insights across the organization with crisp clear reporting.
High-level data at your fingertips
The Dashboard part of the Admin Portal gives you quick,
centrally located visibility into any traffic and customer
engagement opportunities or issues with your APIs. It is
available now on all 3scale API Management Platform
plans from free through enterprise.
90. Many of our customers choose
to monetize access to their APIs,
and 3scale makes that very
simple.
We offer key payment solution
integrations with Stripe,
Braintree, or Adyen which all
allow easy end to end billing
between the API consumer and
API provider.
Monetization
Billing and payments management. Setup pricing rules. Invoice every month
91. Red Hat 3Scale AMP91
Packaging, Billing & Payments
Multiple pricing rules
● One time payment
● Fixed recurring
monthly fee
● Variable recurring
monthly fee
● Cost per unit
● Tiered pricing
Billing cycles
Invoices issues on a monthly
basis
● Prepaid (fixed fees
charged beginning of
month, variable fees
charged end of month)
● Postpaid (all fees
charged at the end of
the month)
No credit card details stored
on 3scale infrastructure
Setup pricing rules. Invoice every month. 100% PCI compliant.
92. 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
93. 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
94. 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
95. 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
96. 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