Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
R
rabbitmq_agents
Manage
Activity
Members
Labels
Plan
Issues
14
Issue boards
Milestones
Wiki
Code
Merge requests
8
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
rc
rabbitmq_agents
Commits
1fe0507e
Commit
1fe0507e
authored
5 years ago
by
Eesaan Atluri
Browse files
Options
Downloads
Patches
Plain Diff
Use logging from rc_util
parent
224e63c6
No related branches found
No related tags found
6 merge requests
!147
Merge previous default branch feat-cod-rmq into main
,
!85
kill nginx process running under user from login node
,
!51
Fix acct create wait
,
!39
WIP:Feat cod rmq
,
!31
Feat add user reg logger
,
!38
WIP: Feat cod rmq
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
user_reg_logger.py
+9
-3
9 additions, 3 deletions
user_reg_logger.py
with
9 additions
and
3 deletions
user_reg_logger.py
+
9
−
3
View file @
1fe0507e
...
@@ -2,7 +2,7 @@
...
@@ -2,7 +2,7 @@
import
json
import
json
import
sys
import
sys
import
dataset
import
dataset
import
logging
import
rc_util
from
rc_rmq
import
RCRMQ
from
rc_rmq
import
RCRMQ
from
datetime
import
datetime
from
datetime
import
datetime
...
@@ -10,7 +10,13 @@ from datetime import datetime
...
@@ -10,7 +10,13 @@ from datetime import datetime
task
=
'
reg_logger
'
task
=
'
reg_logger
'
# Instantiate rabbitmq object
# Instantiate rabbitmq object
reg_logger
=
RCRMQ
({
'
exchange
'
:
'
RegUsr
'
,
'
exchange_type
'
:
'
topic
'
})
rc_rmq
=
RCRMQ
({
'
exchange
'
:
'
RegUsr
'
,
'
exchange_type
'
:
'
topic
'
})
# Parse arguments
args
=
rc_util
.
get_args
()
# Logger
logger
=
rc_util
.
get_logger
()
# Define your callback function
# Parse arguments
# Parse arguments
args
=
rc_util
.
get_args
()
args
=
rc_util
.
get_args
()
...
@@ -35,7 +41,7 @@ def log_registration(ch, method, properties, body):
...
@@ -35,7 +41,7 @@ def log_registration(ch, method, properties, body):
logger
.
info
(
"
Start listening to queue: {}
"
.
format
(
task
))
logger
.
info
(
"
Start listening to queue: {}
"
.
format
(
task
))
# Start consuming messages from queue with callback function
# Start consuming messages from queue with callback function
r
eg_logger
.
start_consume
({
r
c_rmq
.
start_consume
({
'
queue
'
:
task
,
'
queue
'
:
task
,
'
routing_key
'
:
"
create.*
"
,
'
routing_key
'
:
"
create.*
"
,
'
cb
'
:
log_registration
'
cb
'
:
log_registration
...
...
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