Sample code to connect RabbitMQ in Pivotal

872 views
Skip to first unread message

Arun Reddy

unread,
Aug 20, 2015, 6:55:15 AM8/20/15
to rabbitmq-users
Hi ,


I'm bit interested in Pivotal CF,hence i have tried to integrate RabbitMQ application in PCF. I used free version RabbitMQ (CloudAMQP Little Lemur)

Could anyone please provide the sample code snippet/ application to connect to Rabbit MQ in PCF.



Thanks In Advance...


Regards,

Arun

Michael Klishin

unread,
Aug 20, 2015, 6:58:30 AM8/20/15
to rabbitm...@googlegroups.com, Arun Reddy
On 20 August 2015 at 13:55:18, Arun Reddy (arunkum...@gmail.com) wrote:
> I'm bit interested in Pivotal CF,hence i have tried to integrate
> RabbitMQ application in PCF. I used free version RabbitMQ (CloudAMQP
> Little Lemur)
>
> Could anyone please provide the sample code snippet/ application
> to connect to Rabbit MQ in PCF.

Connecting to a CloudAMQP hosted service is no different from connecting
to any other external service.

There's a RabbitMQ service for PCF:
http://docs.pivotal.io/rabbitmq-cf/

The tile is released to Pivotal Network. 
--
MK

Staff Software Engineer, Pivotal/RabbitMQ


Ben Laplanche

unread,
Aug 20, 2015, 8:10:03 AM8/20/15
to rabbitmq-users, arunkum...@gmail.com
Hi Arun,

Are you looking at PCF which is the on-premise enterprise version of Cloud Foundry or the publically hosted Cloud Foundry http://run.pivotal.io?

Both options can be connected to CloudAMQP, but the integration for this option is nicer on run.pivotal.io as the service exists in the marketplace so you can easily create an instance and bind to it. On PCF you would need to configure an external service.

If you are looking at PCF you can also deploy the RabbitMQ tile which is built by us, this will appear in the market place and you can easily bind your application to it. There is an environment variable called VCAP_SERVICES exposed to your application which contains the details of how to connect to your instance.

Here is an example application as well showing this working https://github.com/pivotal-cf/rabbit-example-app

Thanks
Ben

Arun Reddy

unread,
Aug 20, 2015, 8:19:28 AM8/20/15
to rabbitmq-users, arunkum...@gmail.com
Exactly Ben.

I'm trying to bind service from run.pivotal.io only . I knew how to connect RabbitMQ locally from standalone application . But don't how to do same by applying (integrating) VCAP_SERVICES properties .

Could you please help me in providing sample code if you don't mind.

Best Regards,
Arun

Michael Klishin

unread,
Aug 20, 2015, 8:25:01 AM8/20/15
to rabbitm...@googlegroups.com, Arun Reddy
On 20 August 2015 at 15:19:29, Arun Reddy (arunkum...@gmail.com) wrote:
> Could you please help me in providing sample code if you don't
> mind.

Ben has posted an example provided by Pivotal:
https://github.com/pivotal-cf/rabbit-example-app
Reply all
Reply to author
Forward
0 new messages