-
I've read the current design of an interceptor here and I also played for quite a bit with source code. It looks like currently it's possible to:
It's however not possible to return result directly WITHOUT further evaluation. I don't know Erlang good, so maybe I overlook some trick. I tried code like this, but it fails. intercept(#'queue.declare'{queue = Queue, passive = Passive} = Method, Content, _VHost) ->
case [Queue, Passive] of
[<<"magic">>, true] ->
MagicNumber = 42,
#'queue.declare_ok'{queue = Queue, message_count = MagicNumber, consumer_count = MagicNumber};
_ ->
{Method, Content}
end; Is there any trick for that or is that just a missing feature? Thank you for any help you can provide 🙏 |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 9 replies
-
Your code looks correct. What is the specific failure you're seeing? If it's a large stacktrace, save it to a file and ATTACH it to your response. Even better, provide a git repository I can clone, with instructions to build and run, to see the same error as you. |
Beta Was this translation helpful? Give feedback.
-
Your return value is wrong in the first case. You need to return |
Beta Was this translation helpful? Give feedback.
Your return value is wrong in the first case. You need to return
{Method, Content}
. You only return Method.