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

doc improvement on "Very, Very Quick" #861

Closed
wlund-pivotal opened this issue Nov 30, 2018 · 2 comments
Closed

doc improvement on "Very, Very Quick" #861

wlund-pivotal opened this issue Nov 30, 2018 · 2 comments

Comments

@wlund-pivotal
Copy link

wlund-pivotal commented Nov 30, 2018

I went to plug this:

`Very, Very Quick
Using plain, imperative Java to send and receive a message:

ConnectionFactory connectionFactory = new CachingConnectionFactory();
AmqpAdmin admin = new RabbitAdmin(connectionFactory);
admin.declareQueue(new Queue("myqueue"));
AmqpTemplate template = new RabbitTemplate(connectionFactory);
template.convertAndSend("myqueue", "foo");
String foo = (String) `template.receiveAndConvert("myqueue");`

in my workspace and got a compile error on admin.declareQueue.

I wanted to check if this was a correct fix or whether I'm doing it wrong:

ConnectionFactory connectionFactory = new CachingConnectionFactory();
AmqpAdmin admin = new RabbitAdmin(connectionFactory);
**admin.declareQueue(QueueBuilder.durable("myqueue").build());**
AmqpTemplate template = new RabbitTemplate(connectionFactory);
template.convertAndSend("myqueue", "foo");
String foo = (String) template.receiveAndConvert("myqueue");
@garyrussell
Copy link
Contributor

Hi Wayne,

You shouldn't have to use a builder.

Perhaps you imported the wrong Queue object. The one you need is import org.springframework.amqp.core.Queue; you probably imported org.springframework.amqp.rabbit.annotation.Queue.

We'll clarify the docs.

@wlund-pivotal
Copy link
Author

wlund-pivotal commented Nov 30, 2018 via email

garyrussell added a commit to garyrussell/spring-amqp that referenced this issue Dec 1, 2018
garyrussell added a commit to garyrussell/spring-amqp that referenced this issue Dec 1, 2018
garyrussell added a commit to garyrussell/spring-amqp that referenced this issue Dec 1, 2018
artembilan pushed a commit that referenced this issue Dec 3, 2018
Resolves #861

* Increase latch wait time for Travis.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants