0

The question about integrating Netty 3 with JCA Resource adapter was already asked. The solution was quite straightforward: write a custom Executor that wraps JCA WorkManager and pass it to NioServerSocketChannelFactory constuctor.

However, threading seems to be heavily refactored in Netty 4 and this approach doesn't work (there's no NioServerSocketChannelFactory class, to start with). There is an option to supply your own ThreadFactory, but obviously, this is not good enough for JCA, since only WorkManager is exposed, not threads, so a simple facade is not possible anymore.

So I think I'm stuck. Is what I am trying to do even possible without lots of code being written?

EDIT: In the end I asked myself why making Resource adapter at all. Instead I just use JMS queues (inbound and outbound) as my integration points between our EE application and standalone server that uses netty and it works fine.

Community
  • 1
  • 1

2 Answers2

0

Not possible to do in netty 4, but looks like it will be available in netty 5, check https://github.com/netty/netty/issues/2250

0

Maybe a little late. But I integrated netty in a resource adapter as well.

In my code, when I find a message to be delivered to the application I directly start, execute or schedule the work directly at the WorkManager in the InboundChannelHandler. IMO with netty 4 there is no need for any separate threading. Netty already does the job and the implementation only has to pass Work from the inbound channel handler to the WorkManager.

Robert Panzer
  • 1,419
  • 12
  • 14
  • I think you're right; only thread that communicates with application has to be managed by AS. Nice thinking outside the box. However, I'm well past design decision and I'm actually quite happy with the much more flexible and robust approach I opted for (see EDIT). If my application on AS crashes, standalone server will still be able to communicate with devices and send messages to JMS server. Still, thanks for dropping by. – Bojan Dolinar Nov 04 '14 at 08:44