Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling deleteMessagePushStatus() getting 404 #57

Open
nodesocket opened this issue May 21, 2015 · 3 comments
Open

Calling deleteMessagePushStatus() getting 404 #57

nodesocket opened this issue May 21, 2015 · 3 comments

Comments

@nodesocket
Copy link

Recently we've been seeing an error when deleting/acknowledging an IronMQ message.

// The call looks like
$ironmq->deleteMessagePushStatus(..., ..., ...);

Response is a 404 with:

 Message not found.

Initially we thought we must be calling deleteMessagePushStatus() multiple times, but after checking our code, there is only a single call.

What is happening?

@nodesocket
Copy link
Author

Anybody?

@Stephenitis
Copy link
Contributor

are you setting a timeout on your message that you place on the queue? (if not the default is still 60 seconds)
how long does the GET, processing, and then send a DELETE?

if could be possible after the first consumer does a GET if 60 seconds(timeout) passes the message ends up back on the queue and is processed by a 2nd consumer. the first consumer sends the delete request which gets received successfully and the second consumer gets a 404 when it attempts a delete.

@nodesocket
Copy link
Author

So, we create a queue for each message (push) and then queue a message. The exact code is like:

////
// Create the IronMQ queue
//
//  Unicast queue
//      80 retries every 15 seconds, total retry time of 20 minutes.
////
$ironmq_options = array(
    "push_type" => "unicast",
    "retries" => 80,
    "retries_delay" => 15,
    "subscribers" => array(
        array(
            "url" => $subscriber_url,
            "headers" => $ironmq_http_headers
        )
     ),
    "error_queue" => "error-api-executions"
);

$ironmq_queue = $ironmq->updateQueue($ironmq_queue_name, $ironmq_options);

////
// Send the message to the newly created IronMQ queue
//
// Timeout after 20 minutes.
////
$ironmq_response = $ironmq->postMessage($ironmq_queue_name, $json_payload, array(
    "timeout" => 60*20
));

Total time from creating the queue and adding the message to trying to delete it is fast. Basically, as long as it takes Iron.io to send the message to the push endpoint. One of the first things the push endpoint does, is delete the message and queue. So let's call it less than 250ms once Iron.io sends the message to the push endpoint.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants