You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Consume consumes messages from a RabbitMQ queue.
130
-
// It takes a context, an inbound message handler, and metadata as input parameters.
131
-
// The method continuously listens for messages from the queue and handles them using the provided handler.
132
-
// If the context is canceled, the method stops consuming messages and returns.
133
-
// The method returns an error if there was an issue consuming messages.
129
+
// Consume consumes messages from a RabbitMQ queue and handles them using the provided message handler.
130
+
// It takes a context, an inbound message handler, and a map of metadata as input parameters.
131
+
// The function continuously listens for messages from the queue and processes them until the context is canceled.
132
+
// If the context is canceled, the function stops consuming messages and returns.
133
+
// For each received message, the function builds an inbound message, extracts the retry count, and checks if the maximum retry count has been reached.
134
+
// If the maximum retry count has been reached, the message is moved to the dead letter queue.
135
+
// Otherwise, the message is passed to the message handler for processing.
136
+
// The message handler is responsible for handling the message and returning an error if any.
137
+
// If an error occurs while handling the message, it is logged.
138
+
// The function provides methods for acknowledging, rejecting, and moving messages to the dead letter queue.
139
+
// These methods can be used by the message handler to control the message processing flow.
140
+
// The function also logs information about the received message, such as the message ID, topic, action, and timestamp.
141
+
// It applies any configured middlewares to the message handler before calling it.
142
+
// The function returns an error if any occurred during message handling or if the context was canceled.
0 commit comments