Expand my Community achievements bar.

SOLVED

CQ5_5 - Finding a unique id for each requested page ?

Avatar

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

Avatar

Correct answer by
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

5 Replies

Avatar

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.

Avatar

Level 3

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

Avatar

Correct answer by
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.

Avatar

Level 1

Hi thanks

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

Avatar

Level 1

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