Created
December 30, 2022 23:10
-
-
Save dipeshhkc/a01b40e9db5b132998e268e20d9fffdd 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 Task1Controller(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.TASK1, | |
}) | |
utils.FailOnError(err, "Failed to publish a message") | |
c.JSON(http.StatusOK, gin.H{ | |
"message": "Task-1 Received Successfully", | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment