QueueSession session = Message.getResource(QueueSession.class, "Session");
thank you for your answer. Unfortunately, this doesn't work because the getResource() method can be invoked only for an instance of Message. It's not a static method (in Errai 1.1.0.M1 that I use). My problem is: I don't know how to get the (valid and corresponding) Message instance in an RPC method on the server side. In a service class that inherits MessageCallback I get a reference to the Message instance as parameter in the callback. But my RPC service is a standalone class that inherits nothing and implements my RPC interface only. I searched for a solution in documentation and examples. Maybe I missed something...
Yeah, I answered your question a little bit too hastily there. The truth is there's really no way to do it out of the box with RPC calls. The only really reliable way to hack it, would be to use a modified DefautlBlockingServlet which holds a copy of the session in a ThreadLocal and use SimpleDispatcher implementations to prevent any off-thread processing.
But this is definitely something we should consider adding support for.
If you are using errai-cdi you can inject HttpSession object (maybe you do not need queuesession) into the rpc service.
For the sake of completeness: In Errai 2 there is the RpcContext class which provides access to the HttpSession and ServletRequest.