This document discusses cloud integration using node.js and introduces SwarmESB, an integration platform based on the actor model that uses "swarms" of related messages that carry code behaviors. Key concepts of SwarmESB include adapters that interface with external APIs or services, swarm descriptions that define message choreographies through phases and variables, and primitives like "swarm" and "home" that allow message cloning and routing. Examples demonstrate using swarms for load distribution across worker nodes.
2. ● business aspects
● security aspects
● different
○ vendors
○ teams
○ products
● modularity/ product quality
● timing, new requests
What is Integration. Why?
3. ● Real Time Integration
○ Point to Point
■ custom code, exploding complexity, fragility
○ Bus (ESB, MOM)
● Scheduled Integration
○ export/import of files
○ shared databases
○ ETL scripts (Extract/Transform/Load)
Point to Point, Files, Databases
5. ESB : Enterprise Service BUS
MOM: Message Oriented Middleware
EIP: Enterprise Integration Patterns
● Benefits:
○ can easily add or remove integration points later
○ fewer custom configs and simpler deployments (one point of
integration for everybody)
○ bring all integration points to a common platform and protocol
Integration with Bus like systems
6. ● messages / events
● message channel (PUB/SUB, Point to Point)
● message endpoint
● pipes and filters, routing, translator
● guaranteed delivery (duplicates)
● load balancing/load distribution
● logging
● monitoring, throttler, SLA, etc
EIP concepts and concerns
8. Integration Platform as a Service
Many categories of iPaaS vendors
● e-commerce and B2B integration: simple and limited solution
● Enterprise Service Bus (ESB) for hybrid (cloud and on premise)
● Service Oriented Architecture (SOA) infrastructure
iPaaS
9. Service Oriented Architecture
● Orchestration
○ Business Process Management
■ long living processes
■ BPEL (standards)
○ service composition
○ intra-organisation
● Choreography
○ WS-CDL
○ inter-organisation
● SOA v1 (orchestrated services centrally
● SOA v2 (event driven SOA)
BPM, SOA
10. ● actors (Carl Hewitt)
○ message queue
○ adresses
● send asynchronous messages
● behaviour
○ set the behaviour for the next message
○ create new actors
○ learn other address
● mobility, locality
● intuitive, naive messages
● inspired OOP
Concurrency model: Actors
14. Inverted perspective on the actor model
● messages have behaviour
● mobile code nod actors
● decisions in messages not in actors
● distributed in a network (horizontal
scalability)
● Active messages
Swarm communication model
16. ● swarms at runtime
○ kind of message
○ more a set of related messages
○ have behaviours attached
○ have a current phase
○ can exist in multiple nodes
○ can have a single identity for all messages
○ clone itself and visit adapters
Concepts
17. ● adapters
○ somehow like actors: target for messages
○ adapt external APIs or micro-services
○ basically: a collection of functions
Concepts
18. ● swarm description
○ script that describe the choreography
○ a set of phases (functions) that should be
executed
○ also contains
■ ctors (constructors)
■ swarm variables
Concepts
19. ● phases
○ hints about what type of adapter (node) can be execute it
○ contains a function (imperative code)
○ can call adapter’s APIs and swarm, home, broadcast primitives
○ modify swarm variables
Concepts
statusCheck:{
node:"*",
code : function (){
this.status = currentAPI_status(); //set swarm variable
if( this.status == “OK”){ //use swarm variable
this.home("okStatusLogger");
} else {
this.swarm("errorStatusLogger");
}
}
}
20. ● swarm variables
○ variables with a type
○ initialisation
● meta variables (swarm status, control)
Concepts
var: {
hello:”Hello World”
}
21. ● swarm primitives
○ swarm: send a clone of the current swarm in another phase
(another adapter)
○ home: send a clone to the client that started the swarm
○ broadcast: send multiple clones in all adapters of a specified type
Concepts
24. Load distribution with swarms
Adapters:
https://github.com/salboaie/SwarmESB/blob/master/adaptors/Balancer.js
https://github.com/salboaie/SwarmESB/blob/master/adaptors/Worker.js
Swarms:
https://github.com/salboaie/SwarmESB/blob/master/swarms/WorkerSwarm.js
https://github.com/salboaie/SwarmESB/blob/master/swarms/WorkerManagement.js
Test:
https://github.com/salboaie/SwarmESB/blob/master/test/LoadBalancerTest.js
Example