Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
redis_mqtt_subscriber
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ajil.k
redis_mqtt_subscriber
Commits
60f42554
Commit
60f42554
authored
Feb 06, 2023
by
ajil.k
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added
parent
966f3a84
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
main.py
+4
-4
No files found.
main.py
View file @
60f42554
...
@@ -12,11 +12,11 @@ mqtt_client.connect("192.168.0.220", 1883, 60)
...
@@ -12,11 +12,11 @@ mqtt_client.connect("192.168.0.220", 1883, 60)
def
on_message
(
client
,
userdata
,
message
):
def
on_message
(
client
,
userdata
,
message
):
patient_details
=
json
.
loads
(
message
.
payload
.
decode
())
patient_details
=
json
.
loads
(
message
.
payload
.
decode
())
patient_id
=
message
.
topic
topic
=
message
.
topic
print
(
"Connected to "
+
patient_id
)
print
(
"Connected to "
+
topic
)
print
(
f
"{
patient_id
} - {patient_details}"
)
print
(
f
"{
topic
} - {patient_details}"
)
# Store the patient information in the Redis cache
# Store the patient information in the Redis cache
redis_cache
.
set
(
patient_id
,
message
.
payload
.
decode
())
redis_cache
.
set
(
topic
,
message
.
payload
.
decode
())
print
(
"Waiting for messages"
)
print
(
"Waiting for messages"
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment