AMQ adapter version w/o endpints for CleverSwarm integration

This commit is contained in:
Stanislav Hejny
2025-01-23 10:27:21 +00:00
committed by Rui Hu
parent d2b1b59c66
commit 286a4986b3
39 changed files with 1104 additions and 271 deletions
+12
View File
@@ -15,6 +15,18 @@ class AMQResponseFactory:
str(_id), 200, "application/text", "OK".encode("utf-8"), "", "", {}
)
@staticmethod
def of(id: SnowflakeId, response_code: int, content_type: str, body: bytes, trace_info: dict[str,str]) -> AMQResponse:
return AMQResponse(
id=id.as_string(),
response_code=response_code,
content_type=content_type,
response=body,
error=None,
error_cause=None,
trace_info=trace_info
)
@staticmethod
def serialize(response: AMQResponse) -> bytes:
id_bytes = response.id.encode('utf-8')