Robbie Gemmell wrote
> Calling open_sender will open a 'sender' link, and calling
> open_receiver will create a 'receiver' link. The two are mostly
> independent if you are simply sending to a queue, suggesting any
> difference being seen from adding the latter would probably be some
> interaction with the server configuration, other clients in use, etc.

This was the basic jist I was getting from qpid.log, but wasn't sure there
was something more worthwhile knowing about going on behind the scenes.


Robbie Gemmell wrote
> It seems likely your sender is either never being given any credit to
> send

I've verified I have credit on the sender before I try sending via
on_sender_open.


Robbie Gemmell wrote
> or actually the messages are being sent but just not accepted
> (e.g instead released/modified/rejected) due to the particular setup.

How could I verify this? I don't see anything in my qpid.log that shows the
message is being received/rejected/released/modified.


Robbie Gemmell wrote
> Or it could just be an issue in your program, or the client. Its hard
> to say much based on the limited info here.

Totally fair. Here are the (subjectively) relevant code snippets where I'm
actually trying to "do" something (just trying to do basic ssl setup and
message send to get myself started).

void on_container_start(proton::container &c) override {
    if (!connected()) {
        try {
            cout << "inside on_container_start" << endl;
            stringstream qpidURLBuilder;
            qpidURLBuilder << "amqps://";
            qpidURLBuilder << this->brokerURI;
            qpidURLBuilder << ":";
            qpidURLBuilder << this->portNumber;
            string qpidURL = qpidURLBuilder.str();
            connection_options connectionOptions;
            cout << "setting ssl connectionOptions..." << endl;
            string envCertPassword = "password";
            string certName = "/home/mrich/guest.crt";
            string certKey = "/home/mrich/guest.key";
            string server_ca = "/home/mrich/root.crt";
            ssl_certificate client_cert = ssl_certificate(certName,
                   certKey, envCertPassword);
            ssl_client_options ssl_cli(client_cert, server_ca,
proton::ssl::VERIFY_PEER);
            connectionOptions.sasl_allowed_mechs("EXTERNAL");
            connectionOptions.ssl_client_options(ssl_cli);
            cout << "preparing to connect to qpid..." << endl;
            this->conn = c.connect(qpidURL, connectionOptions);
        } catch (const std::exception& error) {
            cerr << error.what() << endl;
            cleanup();
        }
    }
}

void on_connection_open(proton::connection &c) override {
    c.open_sender("external.dropbox");
    //c.open_receiver("external.dropbox");
    cout << "connection has been opened..." << endl;
    this->isConnected = true;
}

int send() {
    int messagesProcessed = 0;
    if (!connected()) {
        return -1;
    }
    string loc;
    string header;
    try {
        while (this->sent < this->maxMessagesPerSend) {
            message msg;
            msg.durable(true);
            msg.id(this->sent);
            header="gobble-dee-goo" + to_string(this->sent);
            msg.subject(header);
            loc="blah-blah-blah";
            msg.body(loc);
            this->sndr.send(msg);
            cout << "attempting to send message: " << fileHeader << endl;
            messagesProcessed++;
            this->sent++;
            sleep(1);
        }
    } catch (const std::exception& error) {
        cerr << error.what() << endl;
        cleanup();
    }
    return messagesProcessed;
}

To reiterate my previous comment, when I use c.open_receiver in
on_connection_open, the messages successfully go through. Without it,
though, I don't see any sign the message is successfully sending.

Also, I'm not sure if it adds anything regarding qpid configuration, but we
are also using Qpid JMS and Proton Python. I've successfully got those
working (connecting/sending/receiving/etc.), but Proton C++ is providing the
most difficult to properly set up and consistently get working. This merely
lends to the thought that my issue seems code related and not necessarily
qpid configuration related. I could very well be off base, though.

Thanks again,

Matt R.



--
Sent from: http://qpid.2158936.n2.nabble.com/Apache-Qpid-users-f2158936.html

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to