Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

SOLVED

CQ5_5 - Finding a unique id for each requested page ?

christopher_to1
Level 1
Level 1

Is there a way to get a unique id  from  the httpRequest or somewhere for each page request ?

I noticed the request_id is the same for the same page run from different browsers. I did see this cb (call back) id that seems unique for each page request.

1 Accepted Solution
kalyanar
Correct answer by
Employee
Employee

In a request filter, you can then set a random number and use it all the way through..? Your filter can haev service ranking as Integer.maximum to come first i think.

View solution in original post

0 Replies
kalyanar
Employee
Employee

May be the current thread id would be unique for each request? Can you try that and let me know if this is not going to meet your req. The reason i feel current thread id would work is, each req is assigned a thread.

JE_Bailey
Level 3
Level 3

AEM uses thread pooling for handling of requests. So the same thread could handle multiple requests, one after another, before being closed.

kalyanar
Correct answer by
Employee
Employee

In a request filter, you can then set a random number and use it all the way through..? Your filter can haev service ranking as Integer.maximum to come first i think.

View solution in original post

christopher_to1
Level 1
Level 1

Hi thanks

I did see the same thread id being used again later, I'll try the filter.

christopher_to1
Level 1
Level 1

thanks - a double random number set in the request bean seems to be working well