Created
December 30, 2022 23:10
-
-
Save dipeshhkc/a33854a4916921c8f1b1e855495c75e8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func Task2Controller(c *gin.Context) { | |
ch := lib.RabbitChannel | |
err := ch.Publish( | |
"", // exchange | |
constants.QUEUE, // routing key | |
false, // mandatory | |
false, // immediate | |
amqp.Publishing{ | |
ContentType: "text/plain", | |
Body: nil, | |
Type: constants.TASK2, | |
}) | |
utils.FailOnError(err, "Failed to publish a message") | |
c.JSON(http.StatusOK, gin.H{ | |
"message": "Task-2 Received Successfully", | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment