The Cloud Foundry Blog

Cloud Foundry Integration for Eclipse Now Supports Tunneling to Services

Today we announce a new release of Cloud Foundry Integration for Eclipse which features the ability to open a tunnel to any Cloud Foundry data service. Now Eclipse users can use familiar client applications to directly analyze, manipulate, or port the data contained in their Cloud Foundry applications.

The Cloud Foundry Data Tunneling service can be created from the Services table in the Cloud Foundry Eclipse server editor. The new integration (version 1.1.0)  allows users to create data tunneling (also known as ‘Caldecott‘) from within Eclipse Indigo JEE or SpringSource Tool Suite (STS) version 2.9.0 or higher.

Follow the documented instructions to install the Cloud Foundry Integration for Eclipse. If you had previously installed the Cloud Foundry plugin in Eclipse or STS, the update will be automatically detected or you can manually check for updates in the IDE.

Creating a Tunnel

You can create a tunnel to connect to any running service in your Cloud Foundry account. Go to the Applications tab in the Cloud Foundry Server view. There is a listing of existing services under the Services section. Creating a tunnel is performed by simply right-clicking on a service in the table and selecting “Open Caldecott Tunnel” menu action:

This will automatically publish a tunneling application to your account, if one isn’t already published, and start or restart the application as necessary. This tunneling application will appear in the list of published applications as Caldecott. Cloud Foundry will also automatically bind the selected service to the Caldecott application prior to opening a tunnel.

The process of creating a tunnel requires services to be bound to the tunneling application. Cloud Foundry will automatically stop a running Caldecott application, bind the service, and restart the application to create the tunnel. Therefore, existing tunnels may be closed when a new tunnel is created, if the desired service was not previously bound to the tunneling application. Multiple tunnels can be opened to different services in your account at the same time, as long as all the related services are already bound to the Caldecott application prior to creating the data tunnels.

In general, any operation that requires the tunneling application to be stopped, restarted or removed will result in all existing  tunnels being disconnected. Manually unbinding a service from the Caldecott application through the Services table will also result in the associated tunnel being disconnected.

Once a tunnel is successfully created, a dialogue will open displaying the data service tunnel information necessary to use a tool like the Eclipse Data Source Explorer to connect to a data service in a Cloud Foundry server. The information displayed includes a username, password, and local port number:

As URLs are needed for database connections in tools like the Eclipse Data Source Explorer, they are automatically constructed for certain data services like MySQL and PostgreSQL. That way, users do not need to manually construct them when creating a database connection.

Right-clicking on the tunnel entry in the tunnel dialogue will display several context menu actions to copy field values to the clipboard. The menu action to copy the URL appears if the service is of MySQL or PostgreSQL type:

Managing Tunnels

Once a tunnel is opened, it can be managed from the Services table in the Cloud Foundry server editor. A sortable “Tunnel” column indicates which services have an open tunnel:

Right-clicking on a service allows users to either disconnect the tunnel or show the tunnel information.

Data tunnels can also be managed in the Servers view by right-clicking on a server instance and options will be presented to manage individual tunnels via wizard flow or disconnecting all existing tunnels:

These Servers view context menu actions are only displayed if the server has at least one active tunnel.

Creating Database Connections

Using the service tunnel information, database connections can then be created with the Eclipse Data Source Explorer, which is available by default in STS and Eclipse Indigo JEE installations:

Once a database connection is established, the database can be accessed through the Data Source Explorer:

To disconnect the tunnel, all data service connections must be disconnected. Therefore, active data service connections created by tools, such as the Data Source Explorer, must be terminated prior to disconnecting the tunnel from the Services table.

Cloud Foundry Integration for Eclipse 1.1.0 can be installed or updated from the official update site:

http://dist.springsource.com/release/TOOLS/cloudfoundry/

- The Cloud Foundry Team

Don’t have a Cloud Foundry account yet? Signup for free today

This entry was posted in Cloud Foundry, Media and tagged , , , , . Bookmark the permalink.

6 Responses to Cloud Foundry Integration for Eclipse Now Supports Tunneling to Services

  1. Pingback: Life in the Cloud at VMworld 2012 | The Console Blog - VMware Blogs

  2. Pingback: Cloud Foundry Integration for Eclipse Now Supports Standalone Java Applications and Java 7 | CloudFoundry.com Blog

  3. Pingback: Cloud Foundry Integration for Eclipse Now Supports Standalone Java Applications and Java 7 - Platform as a Service Magazine

  4. Gopi says:

    I already experimented this from STS and working great which is so cool. Waiting for this from long time though. Great Job CloudFoundry..I am a fan for you all.

  5. Eric Williams says:

    Hi,
    I have tried for a week to connect a local application to a remote rabbitMQ service but the lign:
    connection = factory.newConnection();
    always throws an IOException because of a java.net.SocketTimeoutException: Read timed out
    I have correctly followed the steps of this tutorial to create the tunnel an collect it’s informations but however it still don’t work.
    Here is the lign i use for connecting my local app:

    String rabbitMQURI = “amqp://ubSGLHE7886x6:pk6NV4xxxxxx@localhost:10100/ve296d42a44794aac92536b362681e92a”;
    factory.setUri(rabbitMQURI);

    I would really appreciate to benefit f rom someone’s help !!

    Thanks a lot !

  6. Mustafa says:

    I followed everything you mentioned, however during I pressed the “test connection” it says Ping Failed !. May I know why the IP is 127.0.0.1 ? Will this IP mapped to the database my application uses in the CloudFoundry ?

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>