0

I have created an application of SAP Springboot archetype and published it to SAP Cloud foundry and can see the corelation id being generated in the Kibana Logs.

But I was not able to retrieve the CorelationId. I wanted this generated corelation id to be passed from the publisher to consumer through RabbitMQ.

I have tried a lot but I couldn't succeed. Please let me know how to get this Id?

Sander Wozniak
  • 650
  • 8
  • 27
Arun Kumar
  • 133
  • 8
  • Which correlation Ids are you referring to? – Sander Wozniak Apr 24 '19 at 08:29
  • I am doing an asynchronous call between 2 services(Using SAP Springboot archetype scp-cf-spring) using RabbitMq and we are using the application logger services for logging.I could see the generated correlation id in the Kibana Logs for this application. The same, I wanted to get in my Application code. Please suggest how to get the same. – Arun Kumar Apr 24 '19 at 11:36
  • Hi Arun, if you're satisfied with Sander's answer, please mark it as 'accepted' so other people looking for help can see it. Thanks. – Florian Wilhelm Apr 25 '19 at 09:15

1 Answers1

0

I think this is not possible given that the ID is generated by SAP Cloud Platform when writing the log file. The SDK offers the ErrorResponseBuilder class to generate a reference ID when an exception is thrown in the application to have a reference ID both on the API level (error response) and in the log file. This aims to avoid the exposure of internal application information to the API. But I think this is not exactly what you are aiming for, so you may have to generate an identifier by yourself and bring it to the log.

Sander Wozniak
  • 650
  • 8
  • 27