Skip to content

Commit df99476

Browse files
committed
v1.13.0
1 parent 505d43a commit df99476

File tree

4 files changed

+44
-20
lines changed

4 files changed

+44
-20
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
---
9+
## Version 1.13.0, 4/12/2021
10+
11+
### Added
12+
13+
N/A
14+
15+
### Removed
16+
17+
N/A
18+
19+
### Changed
20+
21+
Update reserved tags for automatic payload segmentation protocol
22+
823
---
924
## Version 1.12.66, 1/20/2021
1025

README.md

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,35 +5,40 @@ The main Mercury project is available at https://github.com/Accenture/mercury
55

66
Please clone the main project and follow the README file to build the mercury core libraries and the language-connector application.
77

8+
## Installing mercury
9+
10+
You may install mercury using pip as follows:
11+
```
12+
pip install git+https://github.com/Accenture/mercury-python.git
13+
```
14+
815
## Welcome to the Mercury project
916

1017
The Mercury project is created with one primary objective - `to make software easy to write, read, test, deploy, scale and manage`.
1118

12-
To this end, it introduces the concept of platform abstraction and takes event driven programming to the next level of simplicity.
19+
It introduces the concept of platform abstraction and takes event driven programming to the next level of simplicity and sophistication.
1320

14-
Everything can be expressed as anonymous functions and they communicate with each other using events. However, event driven and reactive programming can be challenging. The Mercury framework hides all the complexity of event driven and reactive patterns and the magic of inter-service communication.
21+
Everything can be expressed as anonymous functions and they communicate with each other using events. This includes turning synchronous HTTP requests and responses into async events using the REST automation system. However, event driven and reactive programming can be challenging. The Mercury framework hides all the complexity of event driven and reactive patterns and the magic of inter-service communication.
1522

16-
If you want digital decoupling, this is the technology that you should invest 30 minutes of your time to try it out.
23+
If you want digital decoupling, this is the technology that you should invest 30 minutes of your time to get familiar with.
1724

18-
The pre-requisites are very minimal. The foundation technology requires only Java 1.8 JDK or above (Oracle or OpenJDK) and the Maven build system ("mvn"). Docker/Kubernetes are optional. The application modules that you create using the Mercury framework will run in bare metal, VM and any cloud environments.
25+
The pre-requisites are minimal. The foundation technology requires only Java (OpenJDK 8 to 14) and the Maven build system ("mvn"). Docker/Kubernetes are optional. The application modules that you create using the Mercury framework will run in bare metal, VM and any cloud environments.
1926

2027
This project is created by architects and computer scientists who have spent years to perfect software decoupling, scalability and resilience, high performance and massively parallel processing,
2128

2229
With a very high level of decoupling, you can focus in writing business logic without distraction.
2330

24-
Since everything can be expressed as anonymous function, the framework itself is written using this approach. All the cloud connectors and language packs are microservices that are written as anonymous functions. In this way, you can add new connectors, plugins and language packs as you like. The framework is extensible.
31+
Since everything can be expressed as anonymous functions, the framework itself is written using this approach, including the cloud connectors and language pack in the project. In this way, you can add new connectors, plugins and language packs as you like. The framework is extensible.
2532

26-
The concept is simple. You write your business logic as anonymous functions and packaged them in one or more executables. These executables may be composed as Docker images or alike. You can then deploy them. The containers communicate with each other through an event stream system like Hazelcast or Kafka.
33+
The concept is simple. You write your business logic as anonymous functions and packaged them in one or more executables. These executables may be composed as Docker images or alike for deployment. The services in the containers communicate with each other using "service route names".
2734

28-
We make the event stream system works as a service mesh. Functions will talk to each other magically without configuration.
35+
Mercury supports unlimited service route names on top of event stream and messaging systems such as Kafka and Hazelcast. While we make the event stream system works as a service mesh, Mercury can be used in standalone mode for applications that use pub/sub directly.
2936

30-
If you have your own preference of a different event stream system, you can follow the Hazelcast connector as an example to build your own connector.
31-
32-
Hope you enjoy this journey to improve the world.
37+
In fact, you can encapsulate other event stream or even enterprise service bus (ESB) with Mercury. Just use the Kafka and Hazelcast connectors as examples. It would make your ESB runs like an event stream system for RPC, async, callback, streaming, pipeline and pub/sub use cases.
3338

3439
Best regards, the Mercury team, Accenture
3540

36-
January 2021
41+
April 2021
3742

3843
## Rationale
3944

@@ -193,7 +198,7 @@ Please do `pip install wheel` if python wheel is not installed.
193198

194199
Mercury requires python 3.6.7 or above.
195200

196-
## Installing mercury
201+
## Typical installation issue
197202

198203
You may install mercury using pip as follows:
199204
```

mercury/system/connector.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,10 @@ class NetworkConnector:
3939
SERVER_CONFIG = "system.config"
4040
MAX_PAYLOAD = "max.payload"
4141
DISTRIBUTED_TRACING = "distributed.tracing"
42+
# payload segmentation reserved tags (from v1.13.0 onwards)
43+
ID = '_id_'
44+
COUNT = '_blk_'
45+
TOTAL = '_max_'
4246

4347
def __init__(self, platform, distributed_trace, loop, url_list, origin):
4448
self.platform = platform
@@ -113,9 +117,9 @@ def send_payload(self, data: dict):
113117
for i in range(total):
114118
count += 1
115119
block = EventEnvelope()
116-
block.set_header('id', msg_id)
117-
block.set_header('count', count)
118-
block.set_header('total', total)
120+
block.set_header(self.ID, msg_id)
121+
block.set_header(self.COUNT, count)
122+
block.set_header(self.TOTAL, total)
119123
block.set_body(buffer.read(self.max_ws_payload))
120124
block_map = dict()
121125
block_map['type'] = 'block'
@@ -185,10 +189,10 @@ def _incoming(self, headers: dict, body: any):
185189
envelope = EventEnvelope()
186190
inner_event = envelope.from_map(event['block'])
187191
inner_headers = inner_event.get_headers()
188-
if 'id' in inner_headers and 'count' in inner_headers and 'total' in inner_headers:
189-
msg_id = inner_headers['id']
190-
msg_count = inner_headers['count']
191-
msg_total = inner_headers['total']
192+
if self.ID in inner_headers and self.COUNT in inner_headers and self.TOTAL in inner_headers:
193+
msg_id = inner_headers[self.ID]
194+
msg_count = inner_headers[self.COUNT]
195+
msg_total = inner_headers[self.TOTAL]
192196
data = inner_event.get_body()
193197
if isinstance(data, bytes):
194198
buffer = self.cache.get(msg_id)

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from setuptools import setup
55

66
setup(name='mercury',
7-
version='1.12.66',
7+
version='1.13.0',
88
description='Python Language pack for Mercury',
99
author='Eric Law',
1010
author_email='eric.law@accenture.com',

0 commit comments

Comments
 (0)