sycommon-python-lib 0.1.58__py3-none-any.whl → 0.1.59__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.
@@ -257,32 +257,14 @@ class RabbitMQClient:
257
257
 
258
258
  async def _process_message_callback(self, message: AbstractIncomingMessage):
259
259
  try:
260
- msg_obj: MQMsgModel
261
-
262
- # 1. 解析消息
263
- if self.auto_parse_json:
264
- try:
265
- body_dict = json.loads(message.body.decode("utf-8"))
266
- msg_obj = MQMsgModel(**body_dict)
267
- if not msg_obj.traceId:
268
- msg_obj.traceId = message.headers.get(
269
- "trace-id") if message.headers else SYLogger.get_trace_id()
270
- except json.JSONDecodeError as e:
271
- logger.error(f"JSON解析失败: {e}")
272
- await message.reject(requeue=False)
273
- return
274
- else:
275
- msg_obj = MQMsgModel(
276
- body=message.body.decode("utf-8"),
277
- routing_key=message.routing_key,
278
- delivery_tag=message.delivery_tag,
279
- traceId=message.headers.get(
280
- "trace-id") if message.headers else SYLogger.get_trace_id(),
281
- )
260
+ body_dict = json.loads(message.body.decode("utf-8"))
261
+ msg_obj: MQMsgModel = MQMsgModel(**body_dict)
262
+ if not msg_obj.traceId:
263
+ msg_obj.traceId = message.headers.get(
264
+ "trace-id") if message.headers else SYLogger.get_trace_id()
282
265
 
283
266
  SYLogger.set_trace_id(msg_obj.traceId)
284
267
 
285
- # 3. 执行业务逻辑
286
268
  if self._message_handler:
287
269
  await self._message_handler(msg_obj, message)
288
270
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sycommon-python-lib
3
- Version: 0.1.58
3
+ Version: 0.1.59
4
4
  Summary: Add your description here
5
5
  Requires-Python: >=3.11
6
6
  Description-Content-Type: text/markdown
@@ -51,7 +51,7 @@ sycommon/models/mqsend_config.py,sha256=NQX9dc8PpuquMG36GCVhJe8omAW1KVXXqr6lSRU6
51
51
  sycommon/models/sso_user.py,sha256=i1WAN6k5sPcPApQEdtjpWDy7VrzWLpOrOQewGLGoGIw,2702
52
52
  sycommon/notice/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
53
  sycommon/notice/uvicorn_monitor.py,sha256=VryQYcAtjijJuGDBimbVurgwxlsLaLtkNnABPDY5Tao,7332
54
- sycommon/rabbitmq/rabbitmq_client.py,sha256=p_FkNOu0bOSfq2Zs9z23yGhmnuvEylsQaDdnwc8TXdw,16884
54
+ sycommon/rabbitmq/rabbitmq_client.py,sha256=mLdggb_Jv_gDLWXL8nrkKahjsiLNooNgEmPAgWKwHLc,16136
55
55
  sycommon/rabbitmq/rabbitmq_pool.py,sha256=EzM3j3MCLgoy6VW8tLONtcZB3VmYQI7CWi_X1kOdqF8,16194
56
56
  sycommon/rabbitmq/rabbitmq_service.py,sha256=XSHo9HuIJ_lq-vizRh4xJVdZr_2zLqeLhot09qb0euA,2025
57
57
  sycommon/rabbitmq/rabbitmq_service_client_manager.py,sha256=IP9TMFeG5LSrwFPEmOy1ce4baPxBUZnWJZR3nN_-XR4,8009
@@ -82,8 +82,8 @@ sycommon/tools/env.py,sha256=Ah-tBwG2C0_hwLGFebVQgKdWWXCjTzBuF23gCkLHYy4,2437
82
82
  sycommon/tools/merge_headers.py,sha256=u9u8_1ZIuGIminWsw45YJ5qnsx9MB-Fot0VPge7itPw,4941
83
83
  sycommon/tools/snowflake.py,sha256=xQlYXwYnI85kSJ1rZ89gMVBhzemP03xrMPVX9vVa3MY,9228
84
84
  sycommon/tools/timing.py,sha256=OiiE7P07lRoMzX9kzb8sZU9cDb0zNnqIlY5pWqHcnkY,2064
85
- sycommon_python_lib-0.1.58.dist-info/METADATA,sha256=pIdk9am2g0gaL5yDmX36DzFew0LVM857Ct5BaMvQqpA,7331
86
- sycommon_python_lib-0.1.58.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
87
- sycommon_python_lib-0.1.58.dist-info/entry_points.txt,sha256=q_h2nbvhhmdnsOUZEIwpuoDjaNfBF9XqppDEmQn9d_A,46
88
- sycommon_python_lib-0.1.58.dist-info/top_level.txt,sha256=98CJ-cyM2WIKxLz-Pf0AitWLhJyrfXvyY8slwjTXNuc,17
89
- sycommon_python_lib-0.1.58.dist-info/RECORD,,
85
+ sycommon_python_lib-0.1.59.dist-info/METADATA,sha256=sZT5EhFuzDcvhX9Q68MmljOgn5A4irjOxC0RI29X7gw,7331
86
+ sycommon_python_lib-0.1.59.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
87
+ sycommon_python_lib-0.1.59.dist-info/entry_points.txt,sha256=q_h2nbvhhmdnsOUZEIwpuoDjaNfBF9XqppDEmQn9d_A,46
88
+ sycommon_python_lib-0.1.59.dist-info/top_level.txt,sha256=98CJ-cyM2WIKxLz-Pf0AitWLhJyrfXvyY8slwjTXNuc,17
89
+ sycommon_python_lib-0.1.59.dist-info/RECORD,,