amqp-client-python 0.2.0__py3-none-any.whl → 0.2.1.dev1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- amqp_client_python/__init__.py +11 -0
- amqp_client_python/domain/models/__init__.py +6 -0
- amqp_client_python/domain/models/config.py +5 -12
- amqp_client_python/domain/models/options.py +1 -5
- amqp_client_python/domain/models/ssl_options.py +1 -6
- amqp_client_python/domain/utils/__init__.py +5 -0
- amqp_client_python/event/__init__.py +9 -0
- amqp_client_python/exceptions/__init__.py +12 -0
- amqp_client_python/rabbitmq/__init__.py +15 -1
- amqp_client_python/rabbitmq/async_channel.py +58 -27
- amqp_client_python/rabbitmq/async_connection.py +287 -41
- amqp_client_python/rabbitmq/async_eventbus_rabbitmq.py +67 -43
- amqp_client_python/rabbitmq/channel_rabbitmq.py +26 -14
- amqp_client_python/rabbitmq/connection_rabbitmq.py +5 -5
- amqp_client_python/rabbitmq/eventbus_rabbitmq.py +4 -4
- {amqp_client_python-0.2.0.dist-info → amqp_client_python-0.2.1.dev1.dist-info}/METADATA +40 -14
- {amqp_client_python-0.2.0.dist-info → amqp_client_python-0.2.1.dev1.dist-info}/RECORD +21 -21
- {amqp_client_python-0.2.0.dist-info → amqp_client_python-0.2.1.dev1.dist-info}/WHEEL +1 -1
- {amqp_client_python-0.2.0.dist-info → amqp_client_python-0.2.1.dev1.dist-info/licenses}/LICENSE +0 -0
|
@@ -23,8 +23,8 @@ class AsyncEventbusRabbitMQ:
|
|
|
23
23
|
rpc_server_auto_ack: bool = False,
|
|
24
24
|
) -> None:
|
|
25
25
|
"""
|
|
26
|
-
Create an AsyncEventbusRabbitMQ object
|
|
27
|
-
|
|
26
|
+
Create an AsyncEventbusRabbitMQ object that interacts with Bus that provides
|
|
27
|
+
some connection management abstractions
|
|
28
28
|
|
|
29
29
|
Args:
|
|
30
30
|
config: the Config object
|
|
@@ -40,27 +40,25 @@ class AsyncEventbusRabbitMQ:
|
|
|
40
40
|
rpc_server_auto_ack: set to True to ack messages before processing on rpc server connection
|
|
41
41
|
|
|
42
42
|
Returns:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Raises:
|
|
43
|
+
None: None
|
|
46
44
|
|
|
47
45
|
Examples:
|
|
48
46
|
>>> async_eventbus = AsyncEventbusRabbitMQ(
|
|
49
47
|
config, loop, rpc_client_publisher_confirms=True,
|
|
50
48
|
rpc_server_publisher_confirms=False, rpc_server_auto_ack=False)
|
|
51
49
|
### register subscribe
|
|
52
|
-
>>> def
|
|
50
|
+
>>> def subscribe_handler(body):
|
|
53
51
|
print(f"do something with: {body}")
|
|
54
|
-
>>>
|
|
55
|
-
>>> await eventbus.subscribe(subscribe_event, handler, "user.find")
|
|
52
|
+
>>> await eventbus.subscribe("rpc_exchange", "user.find", subscribe_handler)
|
|
56
53
|
### provide resource
|
|
57
|
-
>>> def
|
|
54
|
+
>>> def rpc_provider_handler(body) -> Union[str, bytes]:
|
|
58
55
|
print(f"do something with: {body}")
|
|
59
|
-
return "response"
|
|
60
|
-
>>> await eventbus.provide_resource("user.find2",
|
|
56
|
+
return b"response"
|
|
57
|
+
>>> await eventbus.provide_resource("user.find2", rpc_provider_handler)
|
|
61
58
|
"""
|
|
62
59
|
self._loop: Optional[AbstractEventLoop] = loop
|
|
63
60
|
self._signal = Signal()
|
|
61
|
+
self._used_connections: List[AsyncConnection] = []
|
|
64
62
|
self._pub_connection = AsyncConnection(
|
|
65
63
|
self._loop,
|
|
66
64
|
pub_publisher_confirms,
|
|
@@ -108,7 +106,7 @@ class AsyncEventbusRabbitMQ:
|
|
|
108
106
|
**kwargs
|
|
109
107
|
) -> bytes:
|
|
110
108
|
"""
|
|
111
|
-
Sends a publish message to queue of the bus and waits for a response
|
|
109
|
+
Sends a publish message to a queue of the bus and waits for a response
|
|
112
110
|
|
|
113
111
|
Args:
|
|
114
112
|
exchange: exchange name
|
|
@@ -125,14 +123,14 @@ class AsyncEventbusRabbitMQ:
|
|
|
125
123
|
|
|
126
124
|
Raises:
|
|
127
125
|
AutoReconnectException: when cannout reconnect on the gived timeout
|
|
128
|
-
PublishTimeoutException: if publish confirmation is
|
|
126
|
+
PublishTimeoutException: if publish confirmation is set to True and \
|
|
129
127
|
does not receive confirmation on the gived timeout
|
|
130
|
-
NackException: if publish confirmation is
|
|
128
|
+
NackException: if publish confirmation is set to True and receives a nack
|
|
131
129
|
ResponseTimeoutException: if response timeout is reached
|
|
132
130
|
RpcProviderException: if the rpc provider responded with an error
|
|
133
131
|
|
|
134
132
|
Examples:
|
|
135
|
-
>>> await eventbus.rpc_client("example.rpc", "user.find",
|
|
133
|
+
>>> await eventbus.rpc_client("example.rpc", "user.find", {"name": "example"}, "application/json")
|
|
136
134
|
"""
|
|
137
135
|
|
|
138
136
|
async def add_rpc_client():
|
|
@@ -165,10 +163,10 @@ class AsyncEventbusRabbitMQ:
|
|
|
165
163
|
**kwargs
|
|
166
164
|
) -> Optional[bool]:
|
|
167
165
|
"""
|
|
168
|
-
Sends a publish message to the bus following parameters passed
|
|
166
|
+
Sends a publish message to the bus following the parameters passed
|
|
169
167
|
|
|
170
168
|
Args:
|
|
171
|
-
|
|
169
|
+
exchange_name: exchange name
|
|
172
170
|
routing_key: routing key name
|
|
173
171
|
body: body that will be sent
|
|
174
172
|
content_type: content type of message
|
|
@@ -178,15 +176,14 @@ class AsyncEventbusRabbitMQ:
|
|
|
178
176
|
expiration: maximum lifetime of message to stay on the queue
|
|
179
177
|
|
|
180
178
|
Returns:
|
|
181
|
-
None: if publish confirmation is
|
|
182
|
-
True: if successful when publish confirmation is
|
|
179
|
+
None: if publish confirmation is set to False
|
|
180
|
+
True: if successful when publish confirmation is set to True
|
|
183
181
|
|
|
184
182
|
Raises:
|
|
185
183
|
AutoReconnectException: when cannout reconnect on the gived timeout
|
|
186
|
-
PublishTimeoutException: if publish confirmation is
|
|
184
|
+
PublishTimeoutException: if publish confirmation is set to True and \
|
|
187
185
|
does not receive confirmation on the gived timeout
|
|
188
|
-
NackException: if publish confirmation is
|
|
189
|
-
|
|
186
|
+
NackException: if publish confirmation is set to True and receives a nack
|
|
190
187
|
|
|
191
188
|
Examples:
|
|
192
189
|
>>> exchange_name = "example.rpc"
|
|
@@ -212,30 +209,27 @@ class AsyncEventbusRabbitMQ:
|
|
|
212
209
|
async def provide_resource(
|
|
213
210
|
self,
|
|
214
211
|
name: str,
|
|
215
|
-
handler: Callable[[
|
|
216
|
-
|
|
212
|
+
handler: Callable[[Any], Awaitable[Union[bytes, str]]],
|
|
213
|
+
timeout: Optional[int] = None,
|
|
217
214
|
connection_timeout: int = 16,
|
|
218
215
|
) -> None:
|
|
219
216
|
"""
|
|
220
|
-
Register a provider to listen on
|
|
217
|
+
Register a provider to listen on RPC request queue
|
|
221
218
|
|
|
222
219
|
Args:
|
|
223
220
|
name: routing_key name
|
|
224
221
|
handler: message handler, it will be called when a message is received
|
|
225
|
-
|
|
222
|
+
timeout: timeout in seconds for waiting for process the received message
|
|
226
223
|
connection_timeout: timeout for waiting for connection restabilishment
|
|
227
224
|
|
|
228
|
-
Returns:
|
|
229
|
-
None: None
|
|
230
|
-
|
|
231
225
|
Raises:
|
|
232
226
|
AutoReconnectException: when cannout reconnect on the gived timeout
|
|
233
227
|
|
|
234
228
|
Examples:
|
|
235
|
-
>>> async def
|
|
229
|
+
>>> async def handler(body) -> Union[bytes, str]:
|
|
236
230
|
print(f"received message: {body}")
|
|
237
231
|
return b"[]"
|
|
238
|
-
>>> await eventbus.provide_resource("user.find",
|
|
232
|
+
>>> await eventbus.provide_resource("user.find", handler)
|
|
239
233
|
"""
|
|
240
234
|
|
|
241
235
|
async def add_resource():
|
|
@@ -244,10 +238,11 @@ class AsyncEventbusRabbitMQ:
|
|
|
244
238
|
self.config.options.rpc_exchange_name,
|
|
245
239
|
name,
|
|
246
240
|
handler,
|
|
247
|
-
|
|
241
|
+
timeout,
|
|
248
242
|
)
|
|
249
243
|
|
|
250
|
-
self._rpc_server_connection.open(self.config.url)
|
|
244
|
+
if self._rpc_server_connection.open(self.config.url):
|
|
245
|
+
self._used_connections.append(self._rpc_server_connection)
|
|
251
246
|
await self._rpc_server_connection.add_callback(add_resource, connection_timeout)
|
|
252
247
|
|
|
253
248
|
async def subscribe(
|
|
@@ -255,7 +250,7 @@ class AsyncEventbusRabbitMQ:
|
|
|
255
250
|
exchange_name: str,
|
|
256
251
|
routing_key: str,
|
|
257
252
|
handler: Callable[[Any], Awaitable[None]],
|
|
258
|
-
|
|
253
|
+
timeout: Optional[float] = None,
|
|
259
254
|
connection_timeout: int = 16,
|
|
260
255
|
) -> None:
|
|
261
256
|
"""
|
|
@@ -265,12 +260,9 @@ class AsyncEventbusRabbitMQ:
|
|
|
265
260
|
exchange_name: exchange name
|
|
266
261
|
routing_key: routing_key name
|
|
267
262
|
handler: message handler, it will be called when a message is received
|
|
268
|
-
|
|
263
|
+
timeout: timeout in seconds for waiting for process the received message
|
|
269
264
|
connection_timeout: timeout for waiting for connection restabilishment
|
|
270
265
|
|
|
271
|
-
Returns:
|
|
272
|
-
None: None
|
|
273
|
-
|
|
274
266
|
Raises:
|
|
275
267
|
AutoReconnectException: when cannout reconnect on the gived timeout
|
|
276
268
|
|
|
@@ -279,9 +271,9 @@ class AsyncEventbusRabbitMQ:
|
|
|
279
271
|
print(f"received message: {body}")
|
|
280
272
|
>>> exchange_name = "example"
|
|
281
273
|
>>> routing_key = "user.find3"
|
|
282
|
-
>>>
|
|
274
|
+
>>> timeout = 20
|
|
283
275
|
>>> connection_timeout = 16
|
|
284
|
-
>>> await eventbus.subscribe(exchange_name, routing_key, handle,
|
|
276
|
+
>>> await eventbus.subscribe(exchange_name, routing_key, handle, timeout, connection_timeout)
|
|
285
277
|
"""
|
|
286
278
|
|
|
287
279
|
async def add_subscribe():
|
|
@@ -290,13 +282,45 @@ class AsyncEventbusRabbitMQ:
|
|
|
290
282
|
exchange_name,
|
|
291
283
|
routing_key,
|
|
292
284
|
handler,
|
|
293
|
-
|
|
285
|
+
timeout,
|
|
294
286
|
)
|
|
295
287
|
|
|
296
|
-
self._sub_connection.open(self.config.url)
|
|
288
|
+
if self._sub_connection.open(self.config.url):
|
|
289
|
+
self._used_connections.append(self._sub_connection)
|
|
297
290
|
await self._sub_connection.add_callback(add_subscribe, connection_timeout)
|
|
298
291
|
|
|
299
|
-
async def
|
|
292
|
+
async def restore(self) -> None:
|
|
293
|
+
"""
|
|
294
|
+
Restores connections and subscriptions after a disconnection.
|
|
295
|
+
|
|
296
|
+
This method attempts to reopen connections that were closed and
|
|
297
|
+
re-establishes any previously registered subscriptions and RPC providers.
|
|
298
|
+
|
|
299
|
+
Examples:
|
|
300
|
+
>>> # After a dispose, call restore to re-establish connections
|
|
301
|
+
>>> await eventbus.restore()
|
|
302
|
+
"""
|
|
303
|
+
for connection in self._used_connections:
|
|
304
|
+
if not connection.is_open:
|
|
305
|
+
connection.open(self.config.url)
|
|
306
|
+
|
|
307
|
+
async def dispose(self, stop_event_loop: bool = True) -> None:
|
|
308
|
+
"""
|
|
309
|
+
Closes all connections and optionally stops the event loop.
|
|
310
|
+
|
|
311
|
+
This method properly disposes of all resources used by the event bus,
|
|
312
|
+
including publisher, subscriber, RPC client, and RPC server connections.
|
|
313
|
+
|
|
314
|
+
Args:
|
|
315
|
+
stop_event_loop: Whether to stop the event loop after closing connections.
|
|
316
|
+
|
|
317
|
+
Examples:
|
|
318
|
+
>>> # Close all connections and stop the event loop
|
|
319
|
+
>>> await eventbus.dispose()
|
|
320
|
+
|
|
321
|
+
>>> # Close all connections but keep the event loop running
|
|
322
|
+
>>> await eventbus.dispose(stop_event_loop=False)
|
|
323
|
+
"""
|
|
300
324
|
await self._pub_connection.close()
|
|
301
325
|
await self._sub_connection.close()
|
|
302
326
|
await self._rpc_client_connection.close()
|
|
@@ -127,7 +127,7 @@ class ChannelRabbitMQ:
|
|
|
127
127
|
self.rpc_publisher = False
|
|
128
128
|
self.rpc_consumer = False
|
|
129
129
|
if not self._stopping:
|
|
130
|
-
if not self._connection.is_open
|
|
130
|
+
if not self._connection.is_open:
|
|
131
131
|
if self._connection.ioloop_is_open:
|
|
132
132
|
self._connection.ioloop.call_later(5, self.reconnect)
|
|
133
133
|
# self._connection._connection.ioloop.call_later(5, self._connection.pause)
|
|
@@ -146,7 +146,7 @@ class ChannelRabbitMQ:
|
|
|
146
146
|
LOGGER.debug("Closing the channel")
|
|
147
147
|
self._channel.close()
|
|
148
148
|
|
|
149
|
-
def start_rpc_consumer(self):
|
|
149
|
+
def start_rpc_consumer(self, exchange, routing_key, message, content_type, correlation_id):
|
|
150
150
|
self.rpc_consumer = True
|
|
151
151
|
LOGGER.info("Starting rpc consumer")
|
|
152
152
|
|
|
@@ -162,6 +162,17 @@ class ChannelRabbitMQ:
|
|
|
162
162
|
consumer_tag=None,
|
|
163
163
|
)
|
|
164
164
|
|
|
165
|
+
self._channel.basic_publish(
|
|
166
|
+
exchange,
|
|
167
|
+
routing_key,
|
|
168
|
+
message,
|
|
169
|
+
properties=BasicProperties(
|
|
170
|
+
reply_to=self._callback_queue,
|
|
171
|
+
correlation_id=correlation_id,
|
|
172
|
+
content_type=content_type,
|
|
173
|
+
),
|
|
174
|
+
)
|
|
175
|
+
|
|
165
176
|
LOGGER.info(f"Declaring queue {self._callback_queue}")
|
|
166
177
|
self._channel_rpc.queue_declare(
|
|
167
178
|
queue=self._callback_queue,
|
|
@@ -189,18 +200,19 @@ class ChannelRabbitMQ:
|
|
|
189
200
|
last_id = str(uuid4())
|
|
190
201
|
self.futures[last_id] = future
|
|
191
202
|
self.response = None
|
|
192
|
-
self._channel.basic_publish(
|
|
193
|
-
exchange,
|
|
194
|
-
routing_key,
|
|
195
|
-
message,
|
|
196
|
-
properties=BasicProperties(
|
|
197
|
-
reply_to=self._callback_queue,
|
|
198
|
-
correlation_id=last_id,
|
|
199
|
-
content_type=content_type,
|
|
200
|
-
),
|
|
201
|
-
)
|
|
202
203
|
if not self.rpc_consumer:
|
|
203
|
-
self.start_rpc_consumer()
|
|
204
|
+
self.start_rpc_consumer(exchange, routing_key, message, content_type, last_id)
|
|
205
|
+
else:
|
|
206
|
+
self._channel.basic_publish(
|
|
207
|
+
exchange,
|
|
208
|
+
routing_key,
|
|
209
|
+
message,
|
|
210
|
+
properties=BasicProperties(
|
|
211
|
+
reply_to=self._callback_queue,
|
|
212
|
+
correlation_id=last_id,
|
|
213
|
+
content_type=content_type,
|
|
214
|
+
),
|
|
215
|
+
)
|
|
204
216
|
|
|
205
217
|
def prevent_infinite_loop(last_id):
|
|
206
218
|
if last_id in self.futures:
|
|
@@ -332,5 +344,5 @@ class ChannelRabbitMQ:
|
|
|
332
344
|
future.set_result(body)
|
|
333
345
|
|
|
334
346
|
def close(self):
|
|
335
|
-
if self.is_open
|
|
347
|
+
if self.is_open:
|
|
336
348
|
self._channel.close()
|
|
@@ -56,7 +56,7 @@ class ConnectionRabbitMQ:
|
|
|
56
56
|
|
|
57
57
|
def reconnect(self):
|
|
58
58
|
LOGGER.debug("reconnect %s", self.ioloop_is_open)
|
|
59
|
-
if not self.is_open
|
|
59
|
+
if not self.is_open:
|
|
60
60
|
self._connection = self._connectionFactory.create_connection(
|
|
61
61
|
self._uri,
|
|
62
62
|
self.on_connection_open,
|
|
@@ -119,7 +119,7 @@ class ConnectionRabbitMQ:
|
|
|
119
119
|
"durable": durable,
|
|
120
120
|
"callback": callback,
|
|
121
121
|
}
|
|
122
|
-
if self.is_open
|
|
122
|
+
if self.is_open:
|
|
123
123
|
self._channel.declare_exchange(
|
|
124
124
|
exchange=exchange,
|
|
125
125
|
durable=durable,
|
|
@@ -190,7 +190,7 @@ class ConnectionRabbitMQ:
|
|
|
190
190
|
self.ioloop.add_callback_threadsafe(channel_openned)
|
|
191
191
|
|
|
192
192
|
def channel_open(self, callback=lambda x: x):
|
|
193
|
-
if not self.is_open
|
|
193
|
+
if not self.is_open:
|
|
194
194
|
raise EventBusException("No connection open!")
|
|
195
195
|
if not self.channel_is_open():
|
|
196
196
|
self._channel.open(self, callback)
|
|
@@ -200,7 +200,7 @@ class ConnectionRabbitMQ:
|
|
|
200
200
|
return self._connection and self._connection.is_open
|
|
201
201
|
|
|
202
202
|
def channel_is_open(self):
|
|
203
|
-
return self._channel and self._channel.is_open
|
|
203
|
+
return self._channel and self._channel.is_open
|
|
204
204
|
|
|
205
205
|
def publish(self, exchange_name: str, routing_key: str, message: str):
|
|
206
206
|
if not self.ioloop_is_open:
|
|
@@ -271,5 +271,5 @@ class ConnectionRabbitMQ:
|
|
|
271
271
|
|
|
272
272
|
def close(self):
|
|
273
273
|
self._channel.close()
|
|
274
|
-
if self.is_open
|
|
274
|
+
if self.is_open:
|
|
275
275
|
self._connection.close()
|
|
@@ -185,13 +185,13 @@ class EventbusRabbitMQ:
|
|
|
185
185
|
self.event_loop.add_callback_threadsafe(rpc_server_setup)
|
|
186
186
|
|
|
187
187
|
def dispose(self, stop_event_loop=True):
|
|
188
|
-
if self.pub_connection.is_open
|
|
188
|
+
if self.pub_connection.is_open:
|
|
189
189
|
self.pub_connection.close()
|
|
190
|
-
if self.sub_connection.is_open
|
|
190
|
+
if self.sub_connection.is_open:
|
|
191
191
|
self.sub_connection.close()
|
|
192
|
-
if self.rpc_client_connection.is_open
|
|
192
|
+
if self.rpc_client_connection.is_open:
|
|
193
193
|
self.rpc_client_connection.close()
|
|
194
|
-
if self.rpc_server_connection.is_open
|
|
194
|
+
if self.rpc_server_connection.is_open:
|
|
195
195
|
self.rpc_server_connection.close()
|
|
196
196
|
if stop_event_loop:
|
|
197
197
|
self.event_loop.add_callback_threadsafe(self.event_loop.stop)
|
|
@@ -1,38 +1,40 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: amqp-client-python
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.1.dev1
|
|
4
4
|
Summary: Python AMQP Client Library
|
|
5
|
-
|
|
5
|
+
Project-URL: Homepage, https://github.com/nutes-uepb/amqp-client-python
|
|
6
|
+
Project-URL: Repository, https://github.com/nutes-uepb/amqp-client-python
|
|
7
|
+
Project-URL: Bug Tracker, https://github.com/nutes-uepb/amqp-client-python/issues
|
|
8
|
+
Project-URL: Source, https://github.com/nutes-uepb/amqp-client-python
|
|
9
|
+
Author-email: NUTES UEPB <dev.seniorsaudemovel@gmail.com>
|
|
10
|
+
Maintainer-email: "João Pedro Miranda C. Hluchan" <berrytern@gmail.com>
|
|
6
11
|
License: Apache-2.0
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
Author-email: dev.seniorsaudemovel@gmail.com
|
|
10
|
-
Requires-Python: >=3.7,<4.0
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Keywords: amqp-client-python,dependency,packaging
|
|
11
14
|
Classifier: Development Status :: 5 - Production/Stable
|
|
12
15
|
Classifier: Intended Audience :: Developers
|
|
13
16
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
14
17
|
Classifier: Natural Language :: English
|
|
15
18
|
Classifier: Operating System :: OS Independent
|
|
16
19
|
Classifier: Programming Language :: Python :: 3
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
19
20
|
Classifier: Programming Language :: Python :: 3.9
|
|
20
21
|
Classifier: Programming Language :: Python :: 3.10
|
|
21
22
|
Classifier: Programming Language :: Python :: 3.11
|
|
22
23
|
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
25
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
23
26
|
Classifier: Topic :: Communications
|
|
24
27
|
Classifier: Topic :: Internet
|
|
25
28
|
Classifier: Topic :: Software Development :: Libraries
|
|
26
29
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
27
30
|
Classifier: Topic :: System :: Networking
|
|
28
|
-
Requires-
|
|
29
|
-
|
|
30
|
-
Project-URL: Repository, https://github.com/nutes-uepb/amqp-client-python
|
|
31
|
+
Requires-Python: <4.0,>=3.9
|
|
32
|
+
Requires-Dist: pika<2.0.0,>=1.3.0
|
|
31
33
|
Description-Content-Type: text/markdown
|
|
32
34
|
|
|
33
35
|
# AMQP Client Python
|
|
34
36
|
|
|
35
|
-
|
|
37
|
+
A Python client providing a high-level abstraction for interacting with RabbitMQ, simplifying message publishing, subscribing, and RPC patterns.
|
|
36
38
|
|
|
37
39
|
--------
|
|
38
40
|
|
|
@@ -53,6 +55,18 @@ Client with high level of abstraction for manipulation of messages in the event
|
|
|
53
55
|
|
|
54
56
|
**Source Code**: <a href="https://github.com/nutes-uepb/amqp-client-python" target="_blank">https://github.com/nutes-uepb/amqp-client-python</a>
|
|
55
57
|
|
|
58
|
+
**Discord Server**: <a href="https://discord.gg/RkXNeZpNZk" target="_blank">https://discord.gg/RkXNeZpNZk</a>
|
|
59
|
+
|
|
60
|
+
### 🦀 Looking for higher performance? Try `amqp-rs`!
|
|
61
|
+
If you need higher throughput, thread safety, and built-in compression, check out [**amqp-rs**](https://pypi.org/project/amqp-rs/).
|
|
62
|
+
|
|
63
|
+
It is a high-performance Python extension developed in Rust using PyO3 and `tokio`. It shares a similar API and design philosophy with this library, but adds native thread safety, `zstd`/`zlib`/`lz4` compression, robust TLS/SSL support, and graceful shutdowns.
|
|
64
|
+
|
|
65
|
+
You can install it via `pip` or `uv`:
|
|
66
|
+
```bash
|
|
67
|
+
pip install amqp-rs
|
|
68
|
+
```
|
|
69
|
+
|
|
56
70
|
---
|
|
57
71
|
### Features:
|
|
58
72
|
- Automatic creation and management of queues, exchanges and channels;
|
|
@@ -69,6 +83,18 @@ Client with high level of abstraction for manipulation of messages in the event
|
|
|
69
83
|
| 0.2.0 | 0.2.0 |
|
|
70
84
|
| 0.1.14 | ~0.1.12 |
|
|
71
85
|
|
|
86
|
+
### Installation
|
|
87
|
+
|
|
88
|
+
You can install `amqp-client-python` using pip:
|
|
89
|
+
```bash
|
|
90
|
+
pip install amqp-client-python
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
### Prerequisites
|
|
94
|
+
|
|
95
|
+
* Python 3.7+
|
|
96
|
+
* A running RabbitMQ instance.
|
|
97
|
+
|
|
72
98
|
### Examples:
|
|
73
99
|
#### you can use [sync](https://github.com/nutes-uepb/amqp-client-python/blob/develop/amqp_client_python/rabbitmq/eventbus_rabbitmq.py) , [async eventbus](https://github.com/nutes-uepb/amqp-client-python/blob/develop/amqp_client_python/rabbitmq/async_eventbus_rabbitmq.py) and [sync wrapper](https://github.com/nutes-uepb/amqp-client-python/blob/develop/amqp_client_python/rabbitmq/eventbus_wrapper_rabbitmq.py) of async eventbus
|
|
74
100
|
<details><summary>async usage </summary>
|
|
@@ -229,4 +255,4 @@ When using [**EventbusRabbitMQ**](https://github.com/nutes-uepb/amqp-client-pyth
|
|
|
229
255
|
[known-vulnerabilities-image]: https://snyk.io/test/github/nutes-uepb/amqp-client-python/badge.svg?targetFile=requirements.txt
|
|
230
256
|
[known-vulnerabilities-url]: https://snyk.io/test/github/nutes-uepb/amqp-client-python?targetFile=requirements.txt
|
|
231
257
|
[releases-image]: https://img.shields.io/github/release-date/nutes-uepb/amqp-client-python.svg
|
|
232
|
-
[releases-url]: https://github.com/nutes-uepb/amqp-client-python/releases
|
|
258
|
+
[releases-url]: https://github.com/nutes-uepb/amqp-client-python/releases
|
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
amqp_client_python/__init__.py,sha256=
|
|
2
|
-
amqp_client_python/
|
|
3
|
-
amqp_client_python/
|
|
4
|
-
amqp_client_python/domain/models/
|
|
5
|
-
amqp_client_python/domain/models/
|
|
6
|
-
amqp_client_python/domain/
|
|
1
|
+
amqp_client_python/__init__.py,sha256=XUO7lawlYTTqfS2-oxRmviPz0_KqwIeD1IpugdzZm4U,401
|
|
2
|
+
amqp_client_python/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
+
amqp_client_python/signals.py,sha256=6mW4oWBQnbJwuKox6ceeDbxTM8v9aCDEb0o2zyhpb5g,1263
|
|
4
|
+
amqp_client_python/domain/models/__init__.py,sha256=EgEV-FeMUVMj_7RvhPbnZaqnJaNqTYnIAiEiqSy0ies,154
|
|
5
|
+
amqp_client_python/domain/models/config.py,sha256=g2AWrlEvHCS1h2zlny29phREyG9GmD0rtGQHS3C7LVU,2268
|
|
6
|
+
amqp_client_python/domain/models/options.py,sha256=lx-x4uyMpyjelZjMuyUxLsORz1ro1vDjD33j0EGYD-o,2141
|
|
7
|
+
amqp_client_python/domain/models/ssl_options.py,sha256=xOTSIKfbNZbYepY6o3SxuZvLPX3J5pvRoJXIJlyBsrI,613
|
|
8
|
+
amqp_client_python/domain/utils/__init__.py,sha256=lZL3bwchrTiiKx5d1RSVUJACAuPb7zOnoH9tZ65t_Ok,131
|
|
7
9
|
amqp_client_python/domain/utils/connection_type.py,sha256=AnEF8Nd3cQBCGX8rPKwEkKts8kwnGUAVr0nxnbpynLE,164
|
|
8
10
|
amqp_client_python/domain/utils/types.py,sha256=veT5lgZhUxophpmWItYaz56XxJTXGJ2L6J6oG_TbSWs,160
|
|
9
|
-
amqp_client_python/event/__init__.py,sha256=
|
|
11
|
+
amqp_client_python/event/__init__.py,sha256=vx6_rIQ94xdsPpNBq0peTEDqSU90UNh9YBk1tq5MALg,501
|
|
10
12
|
amqp_client_python/event/async_provider_handler.py,sha256=tncL6X6R9cLLBZLeZ3xsl2ZJVj6Ag84wq79hNRWZSpc,228
|
|
11
13
|
amqp_client_python/event/async_subscriber_handler.py,sha256=bsoX5WDAlRwTnZXy_9xwn4rz29Mj1Sci6v36wkzwlnU,210
|
|
12
14
|
amqp_client_python/event/event.py,sha256=2CSRJJMDI6AZDkO4eXAQdVSW38bdE-CcfbJTdK--cc0,115
|
|
@@ -14,7 +16,7 @@ amqp_client_python/event/integration_event.py,sha256=lVBVA4hnZA77_XrS26yWhegK4n9
|
|
|
14
16
|
amqp_client_python/event/integration_event_handler.py,sha256=eW6m0SD48J0yJhnYFchMHTs1TgQIFLmoRu_xnOyRRXQ,165
|
|
15
17
|
amqp_client_python/event/provider_handler.py,sha256=F8M3XhULNZdta9_OLbOqLoeLXw9WIEeucemGjVPmdWQ,217
|
|
16
18
|
amqp_client_python/event/subscriber_handler.py,sha256=0bb_76kIAofBvBtZvQ2SM2n6e-Ip-L8JA0NvxmimLgc,199
|
|
17
|
-
amqp_client_python/exceptions/__init__.py,sha256=
|
|
19
|
+
amqp_client_python/exceptions/__init__.py,sha256=mBe8Cuir3H5ULHgzRPio05aqRDlcrTDToM4DAfPV3V8,755
|
|
18
20
|
amqp_client_python/exceptions/auto_reconnect_exception.py,sha256=20E806dFoRQcDhdFd0wZWM-QmsxTAKCotZqfepuyNXk,277
|
|
19
21
|
amqp_client_python/exceptions/blocking_exception.py,sha256=QAEIe20r-ND6FOfJTmFdK4ezjHeDr-SJsrWnbXNfal0,277
|
|
20
22
|
amqp_client_python/exceptions/eventbus_exception.py,sha256=999Pn1HPCb_k-0zGUVE4wJo94vLQDZamoZcYHVXRmCI,217
|
|
@@ -24,22 +26,20 @@ amqp_client_python/exceptions/response_timeout_exception.py,sha256=us_PiJPSk1pnz
|
|
|
24
26
|
amqp_client_python/exceptions/rpc_provider_exception.py,sha256=_1Ytb8BOUT_9xEtG_ibGx3cEMMM4kUVtduEVtXn-d6M,280
|
|
25
27
|
amqp_client_python/exceptions/thread_unsafe_exception.py,sha256=zcC4VyuxXWo66Tts1AQtkg07GK3OjXu3LEtt1AUj4jk,281
|
|
26
28
|
amqp_client_python/exceptions/timeout_exception.py,sha256=0YT-vivS44mHF4Jc3o2rlZFc6l_zzNjcxCHPS9ArgN0,271
|
|
27
|
-
amqp_client_python/py
|
|
28
|
-
amqp_client_python/rabbitmq/
|
|
29
|
-
amqp_client_python/rabbitmq/async_channel.py,sha256=xljTUf2XLTpGkLgHM5APNOcC7MGv8Ib68R4UKZHNfvo,25105
|
|
29
|
+
amqp_client_python/rabbitmq/__init__.py,sha256=4N-j8rbrJj0kOOSIhSWJenj6JOJbzFNnW3bxwPGTyuM,941
|
|
30
|
+
amqp_client_python/rabbitmq/async_channel.py,sha256=7QQTKqqe5uFBr9TqUOS0X0tMEMNJavstRnQ9RHWl2wA,26926
|
|
30
31
|
amqp_client_python/rabbitmq/async_channel_factory.py,sha256=ec_5B3Sgazi_ncIG5lI5nnmkH3NprwvyjMhvgpG1BWA,371
|
|
31
|
-
amqp_client_python/rabbitmq/async_connection.py,sha256=
|
|
32
|
+
amqp_client_python/rabbitmq/async_connection.py,sha256=p05Y_1iXcytROZuaPqmodlKxsdxU50ALhEDjN7WqEhw,18308
|
|
32
33
|
amqp_client_python/rabbitmq/async_connection_factory.py,sha256=3N5MM1fPUdodAFLh58rf6vvwN9OAclDVzmG85Qve-Ss,849
|
|
33
|
-
amqp_client_python/rabbitmq/async_eventbus_rabbitmq.py,sha256=
|
|
34
|
+
amqp_client_python/rabbitmq/async_eventbus_rabbitmq.py,sha256=4PCtqhVNT3cq-d0anfdKPzhmmETD-HMqIu-MVuZmZZA,12950
|
|
34
35
|
amqp_client_python/rabbitmq/channel_factory_rabbitmq.py,sha256=h_vGqHgL0DOtXC0tmVd5gzXVlNKL48rxpKpwaN3AlOM,310
|
|
35
|
-
amqp_client_python/rabbitmq/channel_rabbitmq.py,sha256=
|
|
36
|
+
amqp_client_python/rabbitmq/channel_rabbitmq.py,sha256=S3SqGCfVRoIuPyZW40bQZBpWEgbe5YlvZ8ei23a2VVw,13737
|
|
36
37
|
amqp_client_python/rabbitmq/connection_factory_rabbitmq.py,sha256=EKPG5gEsGwtpSKOhoPI5vK1sJOUARbOflOug6VREIrk,1022
|
|
37
|
-
amqp_client_python/rabbitmq/connection_rabbitmq.py,sha256=
|
|
38
|
-
amqp_client_python/rabbitmq/eventbus_rabbitmq.py,sha256=
|
|
38
|
+
amqp_client_python/rabbitmq/connection_rabbitmq.py,sha256=9A8NAPAB3i-5E43SV5sxjKFFoRb4pIhzAAUHrvOvOng,9772
|
|
39
|
+
amqp_client_python/rabbitmq/eventbus_rabbitmq.py,sha256=GZoJGVeBkMTPrQ5dIJqad-MdGmuuJsxGaXV1YGLdk5o,6980
|
|
39
40
|
amqp_client_python/rabbitmq/eventbus_wrapper_rabbitmq.py,sha256=i3C-sZO9EifanfRXReiib56fxxzjV3Cx71rdbJORg78,7442
|
|
40
41
|
amqp_client_python/rabbitmq/ioloop_factory.py,sha256=vfgndKLcazQU0a4elI5RNHnQCTEua--Jjo99bzX8iHo,856
|
|
41
|
-
amqp_client_python/
|
|
42
|
-
amqp_client_python-0.2.
|
|
43
|
-
amqp_client_python-0.2.
|
|
44
|
-
amqp_client_python-0.2.
|
|
45
|
-
amqp_client_python-0.2.0.dist-info/RECORD,,
|
|
42
|
+
amqp_client_python-0.2.1.dev1.dist-info/METADATA,sha256=1PF9aIMEadkewz66TXxQLkFKeYKU6UtEzrbE6VHHRAw,10155
|
|
43
|
+
amqp_client_python-0.2.1.dev1.dist-info/WHEEL,sha256=lCkmxWfQsSc9CfIClYeavTdQeEX2toPqufh9gI35EQA,87
|
|
44
|
+
amqp_client_python-0.2.1.dev1.dist-info/licenses/LICENSE,sha256=QwcOLU5TJoTeUhuIXzhdCEEDDvorGiC6-3YTOl4TecE,11356
|
|
45
|
+
amqp_client_python-0.2.1.dev1.dist-info/RECORD,,
|
{amqp_client_python-0.2.0.dist-info → amqp_client_python-0.2.1.dev1.dist-info/licenses}/LICENSE
RENAMED
|
File without changes
|