Skip to content

Commit e09f13f

Browse files
committed
#8 - refine protocol-level handling, drop MQTT 3.x support
Signed-off-by: Lance-Drane <Lance-Drane@users.noreply.github.com>
1 parent 5a0a752 commit e09f13f

53 files changed

Lines changed: 1170 additions & 913 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ For a high-level overview, please see [the architecture website.](https://inters
1919

2020
- Event-driven architecture
2121
- Support core interaction types: request/response, events, commands, statuses
22-
- Borrows several concepts from [AsyncAPI](https://www.asyncapi.com/docs/reference/specification/latest), and intends to support multiple different protocols. Currently, we support MQTT 3.1.1 and AMQP 0.9.1, but other protocols will be supported as well.
22+
- Borrows several concepts from [AsyncAPI](https://www.asyncapi.com/docs/reference/specification/latest), and intends to support multiple different protocols. Currently, we support MQTT 5.0 and AMQP 0.9.1, but other protocols will be supported as well.
23+
- As a general rule, we will not support any protocols which do not support headers, do not allow for asynchronous messaging, or require the microservice itself to "keep alive" multiple connections.
2324
- Users automatically generate schema from code; schemas are part of the core contract of an INTERSECT microservice, and both external inputs and microservice outputs are required to uphold this contract.
2425

2526
## Authors

examples/1_hello_world/hello_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def simple_client_callback(
4848
'username': 'intersect_username',
4949
'password': 'intersect_password',
5050
'port': 1883,
51-
'protocol': 'mqtt3.1.1',
51+
'protocol': 'mqtt5.0',
5252
},
5353
],
5454
}

examples/1_hello_world/hello_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class HelloServiceCapabilityImplementation(IntersectBaseCapabilityImplementation
2121
but we do not use it here.
2222
2323
The operation we are calling is `say_hello_to_name` , so the message being sent will need to have
24-
an operationId of `say_hello_to_name`. The operation expects a string sent to it in the payload,
24+
an operation_id of `say_hello_to_name`. The operation expects a string sent to it in the payload,
2525
and will send a string back in its own payload.
2626
"""
2727

@@ -50,7 +50,7 @@ def say_hello_to_name(self, name: str) -> str:
5050
'username': 'intersect_username',
5151
'password': 'intersect_password',
5252
'port': 1883,
53-
'protocol': 'mqtt3.1.1',
53+
'protocol': 'mqtt5.0',
5454
},
5555
],
5656
}

examples/1_hello_world/hello_service_schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"type": "string",
5555
"title": "Status"
5656
},
57-
"description": "Rudimentary capability implementation example.\n\nAll capability implementations are required to have an @intersect_status decorated function,\nbut we do not use it here.\n\nThe operation we are calling is `say_hello_to_name` , so the message being sent will need to have\nan operationId of `say_hello_to_name`. The operation expects a string sent to it in the payload,\nand will send a string back in its own payload."
57+
"description": "Rudimentary capability implementation example.\n\nAll capability implementations are required to have an @intersect_status decorated function,\nbut we do not use it here.\n\nThe operation we are calling is `say_hello_to_name` , so the message being sent will need to have\nan operation_id of `say_hello_to_name`. The operation expects a string sent to it in the payload,\nand will send a string back in its own payload."
5858
}
5959
},
6060
"components": {

examples/1_hello_world_amqp/hello_service.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class HelloServiceCapabilityImplementation(IntersectBaseCapabilityImplementation
2222
but we do not use it here.
2323
2424
The operation we are calling is `say_hello_to_name` , so the message being sent will need to have
25-
an operationId of `say_hello_to_name`. The operation expects a string sent to it in the payload,
25+
an operation_id of `say_hello_to_name`. The operation expects a string sent to it in the payload,
2626
and will send a string back in its own payload.
2727
"""
2828

examples/1_hello_world_amqp/hello_service_schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@
5454
"type": "string",
5555
"title": "Status"
5656
},
57-
"description": "Rudimentary capability implementation example.\n\nAll capability implementations are required to have an @intersect_status decorated function,\nbut we do not use it here.\n\nThe operation we are calling is `say_hello_to_name` , so the message being sent will need to have\nan operationId of `say_hello_to_name`. The operation expects a string sent to it in the payload,\nand will send a string back in its own payload."
57+
"description": "Rudimentary capability implementation example.\n\nAll capability implementations are required to have an @intersect_status decorated function,\nbut we do not use it here.\n\nThe operation we are calling is `say_hello_to_name` , so the message being sent will need to have\nan operation_id of `say_hello_to_name`. The operation expects a string sent to it in the payload,\nand will send a string back in its own payload."
5858
}
5959
},
6060
"components": {

examples/1_hello_world_events/hello_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def simple_event_callback(
6868
'username': 'intersect_username',
6969
'password': 'intersect_password',
7070
'port': 1883,
71-
'protocol': 'mqtt3.1.1',
71+
'protocol': 'mqtt5.0',
7272
},
7373
],
7474
}

examples/1_hello_world_events/hello_service.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class HelloServiceCapabilityImplementation(IntersectBaseCapabilityImplementation
2323
but we do not use it here.
2424
2525
The operation we are calling is `say_hello_to_name` , so the message being sent will need to have
26-
an operationId of `say_hello_to_name`. The operation expects a string sent to it in the payload,
26+
an operation_id of `say_hello_to_name`. The operation expects a string sent to it in the payload,
2727
and will send a string back in its own payload.
2828
2929
The operation we are calling also emits its own event.
@@ -58,7 +58,7 @@ def say_hello_to_name(self, name: str) -> str:
5858
'username': 'intersect_username',
5959
'password': 'intersect_password',
6060
'port': 1883,
61-
'protocol': 'mqtt3.1.1',
61+
'protocol': 'mqtt5.0',
6262
},
6363
],
6464
}

examples/1_hello_world_events/hello_service_schema.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
"type": "string",
6060
"title": "Status"
6161
},
62-
"description": "Rudimentary capability implementation example.\n\nAll capability implementations are required to have an @intersect_status decorated function,\nbut we do not use it here.\n\nThe operation we are calling is `say_hello_to_name` , so the message being sent will need to have\nan operationId of `say_hello_to_name`. The operation expects a string sent to it in the payload,\nand will send a string back in its own payload.\n\nThe operation we are calling also emits its own event."
62+
"description": "Rudimentary capability implementation example.\n\nAll capability implementations are required to have an @intersect_status decorated function,\nbut we do not use it here.\n\nThe operation we are calling is `say_hello_to_name` , so the message being sent will need to have\nan operation_id of `say_hello_to_name`. The operation expects a string sent to it in the payload,\nand will send a string back in its own payload.\n\nThe operation we are calling also emits its own event."
6363
}
6464
},
6565
"components": {

examples/1_hello_world_minio/hello_client.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import logging
22

33
from intersect_sdk import (
4-
INTERSECT_JSON_VALUE,
4+
INTERSECT_RESPONSE_VALUE,
55
IntersectClient,
66
IntersectClientCallback,
77
IntersectClientConfig,
@@ -14,7 +14,7 @@
1414

1515

1616
def simple_client_callback(
17-
_source: str, _operation: str, _has_error: bool, payload: INTERSECT_JSON_VALUE
17+
_source: str, _operation: str, _has_error: bool, payload: INTERSECT_RESPONSE_VALUE
1818
) -> None:
1919
"""This simply prints the response from the service to your console.
2020
@@ -59,7 +59,7 @@ def simple_client_callback(
5959
'username': 'intersect_username',
6060
'password': 'intersect_password',
6161
'port': 1883,
62-
'protocol': 'mqtt3.1.1',
62+
'protocol': 'mqtt5.0',
6363
},
6464
],
6565
}

0 commit comments

Comments
 (0)