|
The KeyedDataQueue page of the Toolbox pub has a producer/consumer example using Data Queues. In the example both the producer and consumer are written in Java, but once you have the example working you can switch the producer to be COBOL or RPG. It also shows using the record format classes to describe the data put on the queue. That is probably working to hard to format the data (the example was also trying to show the record format classes). Be sure to look on the keyed data queue page. I could not find a reference to the examples from the base data queue or sequential data queue pages. David Wall Toolbox for Java iSeries ODBC Driver for Linux MEovino@estes-exp ress.com To: java400-l@midrange.com Sent by: cc: java400-l-admin@m Subject: Re: Calling Java from RPG/COBOL idrange.com 05/30/2002 10:18 AM Please respond to java400-l David/David, I am currently having fits with calling a Java program from RPG (it works when I call it from the QSHELL command line, but not when I call it from the RPG program). Can you forward on any links with examples of how to use a Java program as a daemon to monitor a data queue? Thanks in advance! Mike E. "David Morris" <David.Morris@plum To: <java400-l@midrange.com> creek.com> cc: Sent by: Subject: Re: Calling Java from RPG/COBOL java400-l-admin@mi drange.com 05/30/2002 10:39 AM Please respond to java400-l Jon, I would second the recommendation of a queue for any call intensive operation. I have used several techniques and one that works pretty well is a data queue that notifies of an action and passes a key (offset into a user space). You can go either direction with this technique and it is reasonably fast. One advantage is that you can easily multi thread your applications by using more than one listener on your data queue(s). David Morris >>> dawall@us.ibm.com 05/30/02 07:59AM >>> To throw out one more idea, have you thought about using some sort of program-to-program data passing instead of a direct call? For example, use a data queue, a user space, or a data area. Take data queues. The Java program becomes a daemon job waiting for work by listening to the queue. When the RPG/COBOL program has work, it puts an entry on the queue then waits for a reply. Maybe the worst consideration with this setup is managing the Java daemon process. How do you start it, how do you know if it is still active, what authority does it have, etc. On the other hand, a benefit is you can move your Java app to a different machine if you ever need to distribute the work. Toolbox has a DataQueue object that lets you access a queue on the same or a remote box. David Wall Toolbox for Java iSeries ODBC Driver for Linux "Jon Paris" <Jon.Paris@Partne To: <java400-l@midrange.com> r400.com> cc: Sent by: Subject: Calling Java from RPG/COBOL java400-l-admin@m idrange.com 05/29/2002 05:16 PM Please respond to java400-l I'd like to hear from those of you with more "real world" experience than me of the pros and cons of different methods of invoking a Java app from RPG and/or COBOL. One specific item that I'm interested in is parameter passing - and returning results from the Java code. I've used the new RPG method call support and am aware of the pitfalls there, but that is not applicable to COBOL and JNI is just to darned ugly to want to consider unless the alternative is a lobotomy! Jon Paris Partner400 _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l or email: JAVA400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l. _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l or email: JAVA400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l. _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l or email: JAVA400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l. _______________________________________________ This is the Java Programming on and around the iSeries / AS400 (JAVA400-L) mailing list To post a message email: JAVA400-L@midrange.com To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/cgi-bin/listinfo/java400-l or email: JAVA400-L-request@midrange.com Before posting, please take a moment to review the archives at http://archive.midrange.com/java400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.