Submitted by Syd Nicholson on Mon, 07/16/2007 - 00:00
Forums

I want to be able to communicate between two IceBreak servers on two different systems but I am not sure where to start.

In the first instance something simple would be ideal - eg. a test to see if communications is available - perhaps something like:

1. Program on system one sends data to system 2 (eg. a string 'Hello')
2. Program on system 2 sends reply (eg. string 'Hi')

My questions are:

1. The program on system 1 can use ResponseWrite() to send some XML, but how do I specify the target machine for the XML. Using JavaScript I would use the XMLHttpRequest object to do an Ajax call - but how do I do this from RPG?

2. How do I get my program on system 1 to wait for the reply from system 2 - for example - In JavaScript with XMLHttpRequest one would use a call back function - What technology does IceBreak have to minic this?

There is way round this using remote data queues and pure RPG, but this would not be using IceBreak. I would prefer an IceBreak solution.

Any help in this are would be most advantageous.

Many thanks
Syd

Niels Liisberg

Mon, 07/16/2007 - 00:00

Hi Syd;

You are so close to the solution in your own question ...

1) Forget javascript when making icebreak to icebreak connections
2) Use the build in httpRequest or even better the new ILOB_httprequest.

read the tutoriel example 24. It is exactly what you want to do

regards

Niels

Originally Posted by Syd Nicholson:

"Incidentaly - what would you recommend for a time out period in this type of communications.?

If this was in response to a user ajax request, one would not want them getting bored and trying again, or going somewhere else.

Thanks
Syd"


This is realy fast so after 10 sec, dependen on the RPG job ofcause, I thhink will be enough

Originally Posted by Syd Nicholson:

"Thanks Niels,

Job done!

Out of curiosity - what size is the ILOB in IceBreak, is it the old 16MB for a user space, or is it larger than this?

Syd"

The default size i 8 K - but is auto extendable

However we have build a new ilob function that allows you to select your own size:

DSesGetILOB2 pr * extproc(*CWIDEN:'SessionGetILOB2')
D IlobName 256 varying const options(*varsize)
D DftSize 10I 0 value
D HeadSize 10I 0 value

Still it wil auto-exten.

Thanks Niels,

I thought that in recent releases a user space can be larger than 16MB, but I have just checked the IBM infocenter and it appears that 16MB is the absolute limit for a user space maximum size.

From an IceBreak point of view I was thinking of them holding file extract info etc. and the size limit can be limiting with large record lengths combined with a large number of records.

I also use them to cache information - as in the Fortress/400 security product - to avoid having files open all the time, reduce I/O, and increase performance. The cache is updated by trigger programs whenever the DB changes, and the cache can be rebiult at a time selected by the user.

Never mind - we can always be optimistic that IBM will eventually make them bigger. In the meantime I will use user indexes (XLOBs?) because they can hold TBytes of keyed info.

SydÂ