Search code examples
javaqueueserverironmq

How do I need to configure my Java project to make a connection with IronMQ?


I downloaded the libraries and the json file with the connection settings. I put the file in the same level that Mensajes's class, where I try to make the connection. In the class I didn't know how to call the settings on the json file so I found that I can do it replacing the project_id and token in the code below. I did it but still send me an error.

public Mensajes() throws IOException {               
Client client = new Client("project_id","token",Cloud.ironAWSUSEast);          
Queue queue = client.queue("Example_Queue");               
String push = queue.push("Hello world!");
System.out.println(push);         
}

The error that's given me is this:

Exception in thread "main" io.iron.ironmq.HTTPException: Not found
    at io.iron.ironmq.Client.singleRequest(Client.java:231)
    at io.iron.ironmq.Client.request(Client.java:164)
    at io.iron.ironmq.Client.post(Client.java:145)
    at io.iron.ironmq.Queue.push(Queue.java:367)
    at io.iron.ironmq.Queue.push(Queue.java:329)
    at io.iron.ironmq.Queue.push(Queue.java:302)
    at cajerobanco.Mensajes.<init>(Mensajes.java:26)
    at cajerobanco.CajeroBanco.main(CajeroBanco.java:20)

I don't know how to do it and I already tried to look for answers on the web but couldn't find anything.


Solution

  • I realized there was a problem with the library, when I downloaded the files and create the library myself I could do it.