ARGO Messaging Service
Messaging as a Service
GRNET ActiveMQ
Messaging Service
GRNET ActiveMQ
Messaging Service
Why do you want to change it!!
GRNET ActiveMQ
Messaging Service
Why do you want to change it!!
ARGO Messaging Service
GRNET Unified Messaging
To a scalable ΗTTP Messaging Service With:
From a Message Broker Network
Messaging as a Service for everyone !
AMS
ARGO Messaging Service
Fundamentals
Users & Roles
Resource Types
Project
A named resource to which messages are sent by publishers.
Topic
A named resource representing the stream of messages from a single, specific topic
Subscription
The combination of data and attributes
Message
Client that consumes msgs from a topic.
Subscriber
Client that publishes msgs to a topic.
Publisher
A list of service-wide roles. Can be extended. (action is a permission)
Roles
a basis of organizing and isolating groups of users & resources
A mechanism that support schema validation
Schemas
activity of the resources
Metrics
ARGO Messaging Service
Flow
Project 1
Publisher A
Message A
Message A
Subscriber A
Topic A
Subscription A
consumer
publisher
Publisher sends messages to a topic .
Messages are persistently stored in the messaging service until they are delivered to subscribers. The service forwards messages from a topic to all of its subscriptions.
Subscriber receives pending messages from the subscription. Subscriber sends an acknowledgement that he processed the message.
When the message is acknowledged, it is deleted from the AMS.
ARGO Messaging Service
Main Features
Always Follow the Google PUB/SUB features
all
Ease of use
ARGO Messaging Service
Straightforward model with clear semantics
Project 1
Publisher A
Message A
Message A
Subscriber A
Topic A
Subscription A
Publisher B
Message B
Message B
Subscriber B
Topic B
Subscription B1
Message B
Subscriber C
Subscription B2
ARGO Messaging Service
Message
The combination of data and attributes that a publisher sends to a topic and is delivered to subscribers.
Message
{ � "messages":[ � { � "attributes":[ � "key1":"infrastructure",� "key2":"testing"� ],� "data":"U28geW91IHdlbnQgYWhlYWQgYW5kIGRlY29kZWQgdGhpcywgeW91IGNvdWxkbid0IHJlc2lzdCBlaCA/"� }� ]�}
The data that you like to send via the service. The value of the data property must be always encoded in base64 format.
Optional key value pair of metadata you desire.
Attributes:
Data:
ARGO Messaging Service
New ARGO Messaging Service
Publishing: Publisher sends messages to a topic .
curl -X POST -H "Content-Type: application/json" -d { POSTDATA } \ https://{URL}/v1/projects/YOURPROJECT/topics/monitoring:publish?key=eyJhbGciOiJIUzI1NiIsInR5..."
"messages":[ � { � "attributes":[ � { � "key1":"infrastructure",� "key2":"testing"� }
], "data":"U28geW91IHdlbnQgYWhlYWQgYW5kIGRlY29kZWQgdGhpcywgeW91IGNvdWxkbid0IHJlc2lzdCBlaCA/"� }
]
POSTDATA
Publisher A
Message A
Message A
Subscriber A
monitoring
monitoring
PROJECT_NAME
ARGO Messaging Service
New ARGO Messaging Service
Publisher A
Message A
Message A
Subscriber A
monitoring
monitoring
Consuming: Subscriber consumes messages from a topic .
curl -X POST -H "Content-Type: application/json" -d POSTDATA https://{URL}/v1/projects/YOURPROJECT/subscriptions/monitoring:pull?keyJhbGciOiJIUzI1NiIsInR5..."
{
"maxMessages": "100",
}
POSTDATA
PULL MODE
PROJECT_NAME
ARGO Messaging Service
New ARGO Messaging Service
Publisher A
Message A
Message A
Subscriber A
Consuming: Subscriber consumes messages from a topic .
200 OK
{ � "receivedMessages":[ � { � "ackId":"dQNNHlAbEGEIBE...",� "message":{ � "attributes":[ � { � "key1":"infrastructure",� "key2":"testing"� }� ],� "data":"U28geW91IHdlbnQgYWhlYWQgYW5kIGRlY/",� "messageId":"100309303"� }� },
{ � "ackId":"UQJJJHlAbEGEIBE...",
...� }� ]�}
Response
PULL MODE
monitoring
monitoring
PROJECT_NAME
ARGO Messaging Service
New ARGO Messaging Service
Publisher A
Message A
Message A
Subscriber A
Ack msgs: sending message with an array of ackIDs..
PULL MODE
curl -X POST -H "Content-Type: application/json" -d POSTDATA https://{URL}/v1/projects/YOURPROJECT/subscriptions/monitoring:acknowledge?keyJhbGciOiJIUzI1NiIsInR5..."
{� "ackIds": [� "dQNNHlAbEGEIBE..."� ],��}
POSTDATA
monitoring
monitoring
200 OK
RESPONSE
PROJECT_NAME
ARGO Messaging Service
Pull vs Push
Publisher A
Message A
Message A
Subscriber A
In a pull subscription, the subscriber explicitly calls the API pull method, which requests delivery of a message in the subscription queue. The AMS responds with the message (or an error if the queue is empty), and an ack ID. The subscriber then explicitly calls the acknowledge method, using the returned ack ID, to acknowledge receipt.
PULL MODE
In a push subscription, the AMS sends a request to the subscriber application, at a preconfigured endpoint. The endpoints HTTP response serves as an implicit acknowledgement:
The AMS dynamically adjusts the flow of requests and uses an algorithm to rate-limit retries.
PUSH MODE
monitoring
monitoring
PROJECT_NAME
ARGO Messaging Service
The push server(s) are an optional set of worker-machines that are needed when the AMS wants to support push enabled subscriptions.
Push Server
Push WorkFlow
Publisher
Message
AMS
Push Server
Remote Endpoints
Consume Message
Deliver Message
ARGO Messaging Service
New ARGO Messaging Service
Publisher A
Message A
Message A
Subscriber A
PUSH: Modify the push configuration of a subscription
curl -X POST -H "Content-Type: application/json" -d POSTDATA https://{URL}/v1/projects/YOURPROJECT/subscriptions/monitoring:modifyPushConfig
{
"topic":"projects/YOURPROJECT/topics/monitoring",
"pushConfig":{
"pushEndpoint":"https://example.com/alerts/callback",
}
}
POSTDATA
200 OK�{� "name": "projects/EGI/subscriptions/monitoring",� "topic": "projects/EGI/topics/monitoring",� "pushConfig": {� "pushEndpoint": "https://example.com/alerts/callback" � },� "ackDeadlineSeconds": 10 �}��
RESPONSE
PUSH MODE
monitoring
monitoring
PROJECT_NAME
ARGO Messaging Service
New ARGO Messaging Service
Publisher A
Message A
Message A
Subscriber A
Consuming: Subscriber consumes messages.
curl -X POST -H "Content-Type: application/json" -d POSTDATA https://example.com/alerts/callback
{� "message": {� "attributes": {� "string-value": "string-value",� // ... more attributes� },� "data": "base64-no-line-feeds-variant-representation-of-payload",� "message_id": "string-value",� "publish_time": "string-value",� },� "subscription": "string-value"�}
POSTDATA
PUSH MODE
monitoring
monitoring
PROJECT_NAME
AMS Schema Support
On demand mechanism that enables a) the definition of the expected payload schema, b) the definition of the expected set of attributes and values and c) the validation
Schemas
curl -X POST -H "Content-Type: application/json" -d POSTDATA https://{URL}/v1/projects/YOURPROJECT/schemas/SCHEMA
{
"type": "json",
"schema":{
"type": "object",
"properties": {
"name": { "type": "string" },
"email": { "type": "string" },
"address": { "type": "string" },
},
"required": ["name", "email"]
}
}
POSTDATA
Publishers
Acceptable Message
Messages
Schema(filter)
Topic
AMS Metrics
A number of metrics for each resource and the relationships between the resources
Metrics
Operational
Overall
ARGO Messaging Service
Some AMS API Endpoints
/projects
/projects/<project>
Manage projects
/topics
/topics/<topic>
/topics/<topic>:publish
/topics/<topic>:acl
/topics/<topic>:modifyAcl
Manage topics
/users
/users/<user>
/users/<user>:refreshToken
Manage users
/subscriptions
/subscriptions/<sub>:pull
/subscriptions/<sub>:acknowledge
/subscriptions/<sub>:modifyPushConfig
/subscriptions/<sub>:modifyacl
/subscriptions/<sub>:acl
Manage subscriptions
to AMS architecture
From the AMS API
ARGO Messaging Service
ARGO Messaging Service
Zookeeper Cluster: is a centralized service for maintaining configuration information, naming, providing distributed synchronization.
Kafka Cluster: is a distributed publish-subscribe messaging system that is designed to be fast, scalable, and durable.
MetaData store Cluster: a distributed metadata store based on mongodB
from AMS architecture
to AMS Components
AMS Components
From Components
to AMS Use Cases
ΑRGO Messaging Service - Who Uses it
Use Case: Monitoring
Migrating traffic from the old ActiveMQ Message Broker Service
3 Subscribers
3 Topics
3++ Subscriptions
~1450 hosts
pushing 1,3M messages/day
1 Billion messages / year
Use Case: Log aggregation
Log aggregation from the national GRNET infrastructure
2 Subscribers
1 Topic
2 Subscriptions
~1000 devices
pushing 375M logs/month
4.5 Billion logs/year
ARGO Messaging Service
ARGO Messaging Service
Always Follow the Google PUB/SUB features
Operated as production service since September 2016
Support - Help
all
house-keeping
Ease of use
Github: https://github.com/ARGOeu/argo-messaging/
Documentation
Thank you
Questions?