Implement a Nop adapter impl to skip HTTP message processing #123

Open
opened 2026-01-29 05:35:20 +00:00 by hurui200320 · 0 comments
Member

CleverSwarm needs to skip the HTTP message handling part (using reflection to decide which FastAPI method to call), but still wants to be able to use the python library for basic communication (rpc and command).

The adapter will initialize the AMQService, while the basic communication is implemented in the amq service, it requires an adapter during initialization for DataMessageHandler.

There are two options:

  1. Allow passing in None for adapter, thus we skip the HTTP handler part (adapter.on_message call), this way we need to go through the code and check every single place where amq service or the data message handler calls the adapter, and make sure it can work with None value.
  2. Implement a NopAdapter with do nothing (or reply a simple HTTP 503 suggest this instance is not capable of handling HTTP request) in their on_message method to skip the default HTTP handler part. This way we need to ensure the NOP impl won't cause any issue (for example, hangs the loop)
CleverSwarm needs to skip the HTTP message handling part (using reflection to decide which FastAPI method to call), but still wants to be able to use the python library for basic communication (rpc and command). The adapter will initialize the `AMQService`, while the basic communication is implemented in the amq service, it requires an adapter during initialization for DataMessageHandler. There are two options: 1. Allow passing in None for adapter, thus we skip the HTTP handler part (`adapter.on_message` call), this way we need to go through the code and check every single place where amq service or the data message handler calls the adapter, and make sure it can work with None value. 2. Implement a NopAdapter with do nothing (or reply a simple HTTP 503 suggest this instance is not capable of handling HTTP request) in their on_message method to skip the default HTTP handler part. This way we need to ensure the NOP impl won't cause any issue (for example, hangs the loop)
hurui200320 added this to the V.01 milestone 2026-01-29 05:35:20 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
clevermicro/amq-adapter-python#123
No description provided.