Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rabbitmq_agents
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Bo-Chun Chen
rabbitmq_agents
Commits
6bd5bfbf
Commit
6bd5bfbf
authored
1 year ago
by
Bo-Chun Chen
Browse files
Options
Downloads
Patches
Plain Diff
fix: remove assumption on routing_key
parent
566ce576
No related branches found
No related tags found
No related merge requests found
Pipeline
#10351
passed with stage
Stage: test
in 45 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
prod_rmq_agents/user_reg_event_logger.py
+1
-4
1 addition, 4 deletions
prod_rmq_agents/user_reg_event_logger.py
with
1 addition
and
4 deletions
prod_rmq_agents/user_reg_event_logger.py
+
1
−
4
View file @
6bd5bfbf
...
@@ -10,15 +10,12 @@ rc_rmq = RCRMQ({"exchange": "RegUsr", "exchange_type": "topic"})
...
@@ -10,15 +10,12 @@ rc_rmq = RCRMQ({"exchange": "RegUsr", "exchange_type": "topic"})
# Define your callback function
# Define your callback function
def
log_user_reg_events
(
ch
,
method
,
properties
,
body
):
def
log_user_reg_events
(
ch
,
method
,
properties
,
body
):
# Retrieve message
# Retrieve message
msg
=
json
.
loads
(
body
)
msg
=
json
.
loads
(
body
)
# Retrieve routing key
# Retrieve routing key
routing_key
=
method
.
routing_key
routing_key
=
method
.
routing_key
action
=
routing_key
.
split
(
"
.
"
)[
0
]
print
(
f
"
Got a message with routing key:
{
routing_key
}
"
)
user
=
routing_key
.
split
(
"
.
"
)[
1
]
print
(
f
"
Got a
{
action
}
message for
{
user
}
with routing key:
{
routing_key
}
"
)
print
(
msg
)
print
(
msg
)
# Acknowledge message
# Acknowledge message
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment