From the course: DevOps Foundations: Distributed Tracing

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Tracing message queue calls

Tracing message queue calls

From the course: DevOps Foundations: Distributed Tracing

Start my 1-month free trial

Tracing message queue calls

- [Instructor] Let's take a look at how we can trace JMS calls in our app. I'll start with registering a new tracer in our trace configuration class. On line 65, I have a new beam, and we're creating an instance of the JMS tracing class which is supplied by the brave_jms instrumentation. We're calling the new trace of my-broker, and that's how it will appear in Zipkin. Next I will configure the application to leverage the new JMS tracing instance we just registered. Let's take a look at our backend class. I have a putmq endpoint service that will configure to send JMS messages. So my example is fairly simple. We're going to use the MQInitializer class, and we have a special method called handle message. And so here we'll pass our JMS tracing object that was instantiated with a beam, and the username that we're receiving as a query parameter. Now you're probably wondering, well, this looks like ordinary code, but now let's take a look at the MQInitializer handle message method, and how…

Contents