feat: support get queue name

master
JimZhang 10 months ago
parent 444e961892
commit 89ce51d063

@ -270,9 +270,9 @@ class JsonQueue(BaseQueue, Generic[T]):
else:
serialized_data = self.serialize(data)
if properties is None:
properties = {'Content-Type': 'application/json'}
properties = {'content_type': 'application/json'}
elif not properties.get('Content-Type'):
properties['Content-Type'] = 'application/json'
properties['content_type'] = 'application/json'
if not isinstance(serialized_data, bytes):
serialized_data = serialized_data.encode()

@ -20,6 +20,10 @@ class RabbitMQMessage:
def body(self):
return self._amqp_message.deserialized_data
@property
def queue_name(self):
return self._amqp_message.queue_name
@property
def serialized_data(self):
return self._amqp_message.serialized_data

22
poetry.lock generated

@ -349,6 +349,26 @@ type = "legacy"
url = "https://mirror.baidu.com/pypi/simple"
reference = "douban"
[[package]]
name = "pyscan-rs"
version = "0.1.6"
description = "python dependency vulnerability scanner"
category = "dev"
optional = false
python-versions = ">=3.7"
files = [
{file = "pyscan_rs-0.1.6-py3-none-macosx_10_7_x86_64.whl", hash = "sha256:3817087612e25c446f03cda60b38b91f4cf4e3d443ab431889ea58853f4492ab"},
{file = "pyscan_rs-0.1.6-py3-none-macosx_11_0_arm64.whl", hash = "sha256:f5b18b3ed4e1a07bd4171ece221d15d2dc6190ff2ec601c8d70a1c3b77238638"},
{file = "pyscan_rs-0.1.6-py3-none-win32.whl", hash = "sha256:f888cad16b13c49ff1b698724a3092348565776e68b17607b7645ca59e727912"},
{file = "pyscan_rs-0.1.6-py3-none-win_amd64.whl", hash = "sha256:e6cfaee0d9af368b95e70fff33282bc79f8159fe8279697fc3d71a7bd62efd0d"},
{file = "pyscan_rs-0.1.6.tar.gz", hash = "sha256:8102a51d8f52787f24f946fbcdd5b0c130ded0e2cff7ecd08a2746d8fc855a0f"},
]
[package.source]
type = "legacy"
url = "https://mirror.baidu.com/pypi/simple"
reference = "douban"
[[package]]
name = "pytest"
version = "7.4.0"
@ -457,4 +477,4 @@ reference = "douban"
[metadata]
lock-version = "2.0"
python-versions = "^3.8"
content-hash = "c08ff79fd4eebe7caee4016755cdc0f354bd4db0271528a0cdbbc19b0dff89bb"
content-hash = "22a0dc2f63597c3debea2297e8aa2e4ce38235ac6f0b5aac1c88647e0d8fe23b"

@ -1,6 +1,6 @@
[tool.poetry]
name = "amqp-workers"
version = "0.1.3"
version = "0.1.5"
description = "amqp-worker is a Python-based multi-threaded RabbitMQ consumer framework"
authors = ["JimZhang <zzl22100048@gmail.com>"]
readme = "README.md"
@ -23,6 +23,7 @@ orjson = "^3.9.10"
pytest = "^7.3.1"
pytest-mock = "^3.10.0"
oxidized-importer = "^0.6.0"
pyscan-rs = "^0.1.6"
[build-system]
requires = ["poetry-core"]

Loading…
Cancel
Save