1

I'm developing an application on a Weblogic application server, and in my application I have a need to create a new process (python).

This process has 2 output streams (std + err) that should be read by my application, because the OS can freeze the process if these streams' buffers are full.

The thing is, I want to read these streams asynchronously, because I don't really care for the process output, which means that I need 2 new threads for the job (and I don't need to wait for them to stop).

I know it is not recommended to create new threads in an application server, and I wonder what is the best way to handle this case.

wafwaf
  • 651
  • 12
  • 24

1 Answers1

1

You can do this using the Quartz Scheduler

You can configure a Listener which will start up with the Weblogic app and run with it.

If not, it can run based on certain Triggers such as time of day, or day of week and can be configured to run indefinitely or for a specific time period

Quartz manages it's own configured threadpool which will not interfere with Weblogic's threads.

See the FAQ and the Cookbook for patterns and here are the examples

JoseK
  • 31,141
  • 14
  • 104
  • 131
  • Is this a built-in tool? I'd prefer to use a built-in solution for my situation, and I assume there's something like that, as it seems to me that this is a very basic need. – wafwaf Oct 04 '11 at 13:45
  • @wafwaf: No this isnt built-in. It's generally best practice to not manage threadpools yourself within your app server, and Quartz is quite well known in managing this sort of requirement for you. – JoseK Oct 05 '11 at 05:39