views:

24

answers:

1

Hi!

I am developing a WebService in Java upon the jax-ws stack and glassfish.

Now I am a bit concerned about a couple of things.

I need to pass in a unknown amount of binary data that will be processed with a MDB, it is written this way to be asynchronous (so the user does not have to wait for the calculation to take place, kind of fault tolerant aswell as being very scalable.

The input message can however be split into chunks and sent to the MDB or split in the client and sent to the WS itself in chunks.

What I am looking for is a way to be able to specify the max size of the input so I wont blow the heap even if someone delibratly tries to send a to big message. I have noticed that things tend to be a bit unstable once you hit the ceiling and I must be able to keep running.

Is it possible to be safe against big messages or should I try to use another method instead of WS. Which options do I have?

Well I am rather new to Java EE..

+1  A: 

If you're passing binary data take a look at enabling MTOM for endpoint. It utilizes streaming and has 'threshold' parameter.

maximdim