I got the above to work..... I had to move the pcml file to where my
class file is...

thanks so much for your help!


On Tue, Sep 25, 2018 at 3:52 PM Gerald Magnuson <gmagqcy.midrange@xxxxxxxxx>
wrote:

kk... here is my full code... it compiles, but with PCML document
source '/tmp/GETMQMSG.pcml' cannot be found

import com.rabbitmq.client.*;
import com.ibm.as400.access.AS400;
import com.ibm.as400.data.PcmlException;
import com.ibm.as400.data.ProgramCallDocument;
import java.io.IOException;


public class Recv {


public static void main(String[] args) throws Exception {
String hostParm = args[0].trim();
String userNameParm = args[1].trim();
String passwordParm = args[2].trim();
String virtualHostParm = args[3].trim();
String queueNameParm = args[4].trim();
String messageParm = args[5].trim();

ConnectionFactory factory = new ConnectionFactory();
factory.setHost(hostParm);
factory.setUsername(userNameParm);
factory.setPassword(passwordParm);
factory.setVirtualHost(virtualHostParm);

Connection connection = factory.newConnection();
Channel channel = connection.createChannel();

Consumer consumer = new DefaultConsumer(channel) {
@Override
public void handleDelivery(String consumerTag, Envelope envelope,
AMQP.BasicProperties properties, byte[] body)
throws IOException {
String message = new String(body, "UTF-8");

AS400 as400;
ProgramCallDocument pcd;
String path = "/QSYS.LIB/GEMLIB.LIB/GETMQMSG.PGM";
as400 = new AS400 ();
try {
pcd = new ProgramCallDocument(as400, "/tmp/GETMQMSG.pcml");
pcd.setValue ("GETMQMSG.MESSAGE", message);
boolean rc = pcd.callProgram("GETMQMSG");

} catch (PcmlException e) {
e.printStackTrace();
}
}
};
channel.basicConsume(queueNameParm, true, consumer);
}
}

On Tue, Sep 25, 2018 at 3:36 PM Jack Woehr <
jwoehr@xxxxxxxxxxxxxxxxxxxxxxxx> wrote:

On Tue, Sep 25, 2018 at 2:16 PM David Gibbs <david@xxxxxxxxxxxx> wrote:

https://code.midrange.com/692bdd33f5.html


Nice!
--
Absolute Performance, Inc.
12303 Airport Way, Suite 100
Broomfield, CO 80021

NON-DISCLOSURE NOTICE: This communication including any and all
attachments is for the intended recipient(s) only and may contain
confidential and privileged information. If you are not the intended
recipient of this communication, any disclosure, copying further
distribution or use of this communication is prohibited. If you received
this communication in error, please contact the sender and delete/destroy
all copies of this communication immediately.
--
This is the Java Programming on and around the IBM i (JAVA400-L) mailing
list
To post a message email: JAVA400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/java400-l
or email: JAVA400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/java400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2021 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.