wso2 / msf4j

WSO2 Microservices Framework for Java (MSF4J)
http://wso2.com/products/microservices-framework-for-java/
Apache License 2.0
400 stars 348 forks source link

Need Support jax-rs @Provider #295

Open betayoga opened 8 years ago

betayoga commented 8 years ago

I want to create Filter to logging any payload request response in msf4j, but when i used @Provider to create filter, it doesn't work.

thusithathilina commented 8 years ago

@betayoga Is there a possibility for you use an interceptor for the requirement?

betayoga commented 8 years ago

I already trying using method preCall on Interceptor class , but when i invoke method request.getMessageBody() to collect jsonBody, the Netty carbon message always stop in httpContentQueue.take(); in class NettyCarbonMessage.java and waiting never ending. I try to temporary solve this issue with modify method getFullMessageBody() carbonMessage.getFullMessageBody(); with carbonMessage.getCopyOfFullMessageBody(); and already working, but i don't know the impact of this, but i still don't know how to get json response body from interceptor..thanks

thusithathilina commented 8 years ago

@betayoga Thanks for pointing this out. As you have mentioned, with the current implementation we can consume the carbon message only once. But as I understand your requirement is a valid use case and it can't get done with the current implementation. Let see what we can do.