Real-world Microservices: Lessons from the Front Line - Zhamak Delghani, ThoughtWorks
Real-Time Communications between Microservices
-
Upload
solace -
Category
Technology
-
view
238 -
download
4
Transcript of Real-Time Communications between Microservices
![Page 1: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/1.jpg)
1Copyright Solace
Solace Messaging for Pivotal Cloud Foundry
Mark Spielman
![Page 2: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/2.jpg)
2Copyright Solace
Agenda:o Introduction to Solaceo Understanding the Solace Messaging for
PCF Tileo A live demo!
![Page 3: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/3.jpg)
3Copyright Solace
A quick intro to messaging…
![Page 4: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/4.jpg)
4Copyright Solace
o Application Messaging‐ I.e. The exchange of information between
applications using a messaging server where the data is routed based on a destination (often a topic or queue).
o Common Messaging Models:‐ Publish/subscribe‐ Point-to-point or message queueing‐ Others: Request / Reply, stream processing, event
driven, …o Not any of the following:
‐ Text/SMS messaging, Instant messaging, Social chat, Etc…
What messaging am I talking about?
![Page 5: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/5.jpg)
5Copyright Solace
Why Messaging?Infrastructure for reliable data delivery – because it is
difficult!
Simple Producer / Consumer Scalability
Simple, Scalable Connectivity
Simple High Availability
1234 Publish / Subscribe – Message Filtering,
Routing, Fanout
5 Producer / Consumer Decoupling
![Page 6: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/6.jpg)
6Copyright Solace6Copyright Solace
Service Discovery
AnalyticsFraudDetection
Why messaging in PCF applications? – A look at Payment Processing…Option 1: Direct connectivity between services
How do you deal with…
o Slow mainframe application
o Crashing analytics application
o Adding new service
Web Presentation
Audit Loyalty &Rewards
Payment Gateway
PurchaseAuthorization
Mainframe
Load Balancer
Client Model
Payment Network
PaymentCachePayment
Settlement DB
PaymentProcessing
ClientPortal
BackOfficeSystems
![Page 7: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/7.jpg)
7Copyright Solace7Copyright Solace
Messaging
AnalyticsFraudDetection
Why messaging in PCF applications? – A look at Payment Processing… Option 2: An Event Driven Architecture powered by Messaging
Web Presentation
Audit Loyalty &Rewards
Payment Gateway
PurchaseAuthorization
Mainframe
Load Balancer
Client Model
Payment Network
PaymentCachePayment
Settlement DB
PaymentProcessing
ClientPortal
BackOfficeSystems
Benefits of messaging…o Enables deferred
execution through pub/sub
o Promotes loose coupling between services
o Provides burst absorption via queuing
o Simplifies services – publish events once!
o Easily add new services like big data by connecting and subscribing
![Page 8: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/8.jpg)
8Copyright Solace8Copyright Solace
Messaging
AnalyticsFraudDetection
REST vs Messaging for Microservices…
Web Presentation
Audit Loyalty &Rewards
Payment Gateway
PurchaseAuthorization
Mainframe
Load Balancer
Client Model
Payment Network
PaymentCachePayment
Settlement DB
Messaging
REST
o You’ll probably need both!
o REST APIs for external access.
o Messaging between microservices
![Page 9: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/9.jpg)
9Copyright Solace
An Intro to SolaceWhat problem does Solace solve?
![Page 10: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/10.jpg)
10Copyright Solace10Copyright Solace
The shift to the cloud is on…
Source: Wikibon Public and PrivateCloud Research Projects 2016
LegacyDatacenter
PrivateCloud
PublicCloud
LegacyDatacenter Private Cloud
Public Cloud
2026
2016
How do I get there?
![Page 11: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/11.jpg)
11Copyright SolaceConfidential
Public Clouds Private Cloud
Legacy Environment
JMS MQ
? ?? ??
Challenges:• Cloud messaging?• Legacy-to-cloud?• Cloud-to-Cloud?• Application portability?• Enterprise grade features?• Out of the box?• Simplicity?• Robustness?
?
? ? ?
![Page 12: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/12.jpg)
12Copyright Solace
Solace“Open Data Movement ”
![Page 13: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/13.jpg)
13Copyright Solace13Copyright Solace
Open APIs & Protocolso Data
movement is MANY problems
o Use the right tool for every job
o Bridging between all APIs
Objective CiOS
JavaScriptHTML5
Silverlight, Flash & .NET HTTP API
JMS
Python
Ruby
C++
.NET
Perl
JMS/JCA
RESTC
C++
Java
JavaScript
Python
Go
C Java Node.jsC# / .NET
(Soon!)
Boot CloudConnector
CloudStreams
CloudBus
![Page 14: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/14.jpg)
14Copyright Solace
Datacenter
Private Cloud
Legacy
Public Clouds
JMS MQ
Challenges Overcome: Cloud messaging Legacy-to-cloud Cloud-to-Cloud Application portability Enterprise grade features Out of the box Simplicity Robustness
![Page 15: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/15.jpg)
15Copyright Solace
Solace Messaging in Pivotal Cloud Foundry
![Page 16: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/16.jpg)
16Copyright Solace
o Solace tile provides messaging as a service for PCF applications o Key Characteristics
‐ High Performance, Enterprise Grade Stability, In Service Upgrades, Hybrid Cloud Ready
‐ Cloud Operator focused control from Ops Manager‐ Ex: IaaS Usage, instance scale, TLS, LDAP, SYSLOG, …
‐ Developer friendly service-plans and connectivity‐ Right size plans in the PCF marketplace‐ Extensive Open Multi-protocol & API support built-in.
o Solace is a Premier Tier Partner of Pivotal‐ Working jointly on several accounts
Solace Messaging in PCF – A quick summary!
![Page 17: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/17.jpg)
17Copyright Solace
Demo OutlineDeploying Solace Messaging using Ops Manager
A cloud operators perspective Creating service instances in Apps Manager
A developers perspectiveDemo application in action
Handling a burst of trafficScaling the application using PCF and Solace Messaging
Tuning to improve burst handling
![Page 18: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/18.jpg)
18Copyright Solace
Chosen IaaS
PCF ArchitectureElastic Runtime Solace
MessagingRouters
OtherPCFTiles
OtherPCFTiles
Diego
Loggregator
ServiceBrokers
Blobstore
SolaceServiceBroker
PCF Services & Add Ons
Apps Manager
Auto-Scaling
API Gateway
Data Sync
IPSec Add-on
Redis MySQL
Push Notifications
GemFire
Single Sign-On
Metrics Server
Ops Metrics Notifications
BOSH
Pivotal ElasticRuntime
SolaceMessaging
DemoSetup
![Page 19: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/19.jpg)
19Copyright Solace
Offline Content – Available as a tile on Pivotal Network
![Page 20: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/20.jpg)
20Copyright Solace
Solace Messaging Tile for Pivotal Cloud Foundry
BOSH VMR Release
What’s in the Solace Tile?
SolaceMessaging
ServiceBroker
![Page 21: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/21.jpg)
21Copyright Solace
Offline Content - PCF Ops Manager
![Page 22: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/22.jpg)
22Copyright Solace
Offline Content - Solace Config in Ops Manger
![Page 23: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/23.jpg)
23Copyright Solace
Offline Content - VMR Resource Configuration
![Page 24: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/24.jpg)
24Copyright Solace
Demo Outline Deploying Solace Messaging using Ops Manager
A cloud operators perspectiveCreating service instances in Apps Manager
A developers perspectiveDemo application in action
Handling a burst of trafficScaling the application using PCF and Solace Messaging
Tuning to improve burst handling
![Page 25: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/25.jpg)
25Copyright Solace
Solace Messaging – Marketplace and Plans
Service summary as seen in the Cloud Foundry Marketplace
Service details as seen in the Cloud Foundry Marketplace Service details
Service Plan Description
Shared A single Message VPN in a shared Solace Message Router. Useful for light traffic and development. This plan is not feature limited but does have a time limited 90-day evaluation period.
Community A single message VPN on a dedicated Community Edition Solace Message Router. The plan does not have a time limit but is limited by the features available on the Community Edition VMR.
Large A single message VPN on a dedicated Solace Message Router. This plan is not feature limited but does have a time limited 90-day evaluation period.
Medium-HA Service Instance hosted on a dedicated HA VMR Cluster of medium sized VMs.
Large-HA Service Instance hosted on a dedicated HA VMR Cluster of large sized VMs.
Service Plans Description
solace-messaging shared, community, large, medium-ha, large-ha Solace Messaging as a Service
![Page 26: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/26.jpg)
26Copyright Solace
Offline Content - Apps Manager – Plans
![Page 27: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/27.jpg)
27Copyright Solace
Solace Messaging in PCF – Architecture
![Page 28: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/28.jpg)
28Copyright Solace
Deploy Demo Application using CF CLIo How do you get the demo apps into PCF?
1. Create the Solace Messaging Service Instance‐ $ cf create-service solace-messaging shared solace-messaging-demo-instance
2. Push the applications into the PCF Elastic Runtime‐ $ cf push
---applications:
- name: cf-solace-messaging-demo-aggregator-app memory: 512M path: aggregator/build/libs/cf-solace-messaging-demo-aggregator-app.jar services: - solace-messaging-demo-instance
- name: cf-solace-messaging-demo-worker-app memory: 512M path: worker/build/libs/cf-solace-messaging-demo-worker-app.jar services: - solace-messaging-demo-instance
Manifest.yml
![Page 29: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/29.jpg)
29Copyright Solace
Offline Content – Demo App
![Page 30: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/30.jpg)
30Copyright Solace
Offline Content - Apps Manager – Bound Service
![Page 31: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/31.jpg)
31Copyright Solace
Demo Outline Deploying Solace Messaging using Ops Manager
A cloud operators perspectiveCreating service instances in Apps Manager
A developers perspectiveDemo application in action
Handling a burst of trafficScaling the application using PCF and Solace Messaging
Tuning to improve burst handling
![Page 32: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/32.jpg)
32Copyright Solace
Solace Messaging Demo: Horizontal Scaling of Aggregated Microservices
4
AggregatorSolaceServiceBroker
Cloud Controller
Rou
ter 1
2
3
CFAdmin
CLI
Demo UI
Spring Cloud
![Page 33: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/33.jpg)
33Copyright Solace
Offline Content - Demo UI
![Page 34: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/34.jpg)
34Copyright Solace
Demo Outline Deploying Solace Messaging using Ops Manager
A cloud operators perspectiveCreating service instances in Apps Manager
A developers perspectiveDemo application in action
Handling a burst of trafficScaling the application using PCF and Solace Messaging
Tuning to improve burst handling
![Page 35: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/35.jpg)
35Copyright Solace
Solace Messaging Demo: The Problem…
AggregatorSolaceServiceBroker
Cloud Controller
Rou
ter
CFAdmin
CLI
Demo UI
Spring CloudToo
Slow
Solace Buffers Messages
![Page 36: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/36.jpg)
36Copyright Solace
Getting Started with Solace + PCFSolace Dev Portal – Pivotal Cloud Foundry
http://dev.solace.com/clouds/pivotal-cloud-foundry/Pivotal Docs & Download – Solace Messaging for PCF
http://docs.pivotal.io/partners/solace-messaging/ https://network.pivotal.io/products/solace-messaging
Demo App: Horizontal Scaling of Aggregated Microserviceshttps://github.com/SolaceLabs/sl-cf-solace-messaging-demo
More in GitHub – Tutorials, samples and Spring Integrationshttp://dev.solace.com/get-started/pcf-tutorials/ https://github.com/SolaceSamples/solace-samples-cloudfoundry-javahttps://github.com/SolaceLabs/sl-spring-cloud-connectors https://github.com/SolaceLabs/solace-jms-spring-boot
![Page 37: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/37.jpg)
37Copyright Solace
Solace Messaging Demo: The Solution – Scale Workers
AggregatorSolaceServiceBroker
Cloud Controller
Rou
ter
CFAdmin
CLI
Demo UI
Spring Cloud
![Page 38: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/38.jpg)
38Copyright Solace
*challenge* … your turn :-)
![Page 39: Real-Time Communications between Microservices](https://reader036.fdocuments.net/reader036/viewer/2022062302/58ce9de61a28abb26e8b495d/html5/thumbnails/39.jpg)
39Copyright Solace
Getting Started with Solace + PCFSolace Dev Portal – Pivotal Cloud Foundry
http://dev.solace.com/clouds/pivotal-cloud-foundry/Pivotal Docs & Download – Solace Messaging for PCF
http://docs.pivotal.io/partners/solace-messaging/ https://network.pivotal.io/products/solace-messaging
Demo App: Horizontal Scaling of Aggregated Microserviceshttps://github.com/SolaceLabs/sl-cf-solace-messaging-demo
More in GitHub – Tutorials, samples and Spring Integrationshttp://dev.solace.com/get-started/pcf-tutorials/ https://github.com/SolaceSamples/solace-samples-cloudfoundry-javahttps://github.com/SolaceLabs/sl-spring-cloud-connectors https://github.com/SolaceLabs/solace-jms-spring-boot