This forum has been archived. Please start a new discussion on GitHub.

question on batchoneway calls in ICE

I am implementing a module which is publish(server) -subscriber(client) using ICEStorm.
Publisher is publishing messages using batchoneway calls. I could test this scenario successfully without any errors (such as connection timedout or outofmemory exceptions) when I had explicitly flushed the batchedonewayrequests on published based on counts.
e.g. scneario is to publish 100K messages.
called publisher.ice_flushBatchRequests after every 1000 messages. And it works fine.

Now I would like to call this flushBatchrequest on timer basis. i.e. after every few ms .. I tried to configure service.Flush.Timeout and also Ice.BatchAutoFlush. But it did not work. The batched requests were not published based on this time specified in above properties. Also it was giving connection timedout and memory exceptions. As the requests were not flushed in configured time, the memory continuously grows and gives memory exception.

Could you guide on how to set this batchoneway based on specific time?


  • benoit
    benoit Rennes, France

    It is not clear where you set those properties exactly. The <service>.Flush.Timeout property is an IceStorm property and is therefore ignored by any other Ice processes such as your publisher.

    To flush batch requests at regular time intervals in your publisher, you should simply set a timer to call ice_flushBatchRequests. This can easily be done in Java using the java.util.Timer class.

    Btw, please specify which Ice version and operating system you're using if you need further help with this.

  • The <service>.Flush.Timeout property is set in icegrid admin for Icestorm. i.e. the property is IceStorm.Flush.Timeout.

    I have set IceStorm.Flush.Timeout property to 1000 ms (which is also the default value), still it does not flush the batchoneway requests automatically (i.e. after every 1000 ms). But it works when explicit call to ice_flushBatchrequests is made.

    Is it required to explicitly call the ice_flushbatchrequest, even if we have set the Icestorm.Flush.Timeout property in icegrid?
  • benoit
    benoit Rennes, France
    Yes, the IceStorm.Flush.Timeout property has no effects on the behavior of the publisher, it only affects how often IceStorm will flush its batch requests. If you want to flush the batch requests of your publisher at regular time interval you need to implement a timer to do so.

  • Thanks for the reply. Will try using Timer with explicit call to flush the batchrequests.