Skip to content

Commit

Permalink
remove the OpenShif section
Browse files Browse the repository at this point in the history
the WildFly cartridge only support the standalone configuration at the moment and not the full
profile required to use JMS
  • Loading branch information
jmesnil committed Feb 3, 2014
1 parent 2cb2cc4 commit 0477a52
Showing 1 changed file with 0 additions and 93 deletions.
93 changes: 0 additions & 93 deletions helloworld-mdb/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,96 +101,3 @@ If you want to debug the source code or look at the Javadocs of any library in t

mvn dependency:sources
mvn dependency:resolve -Dclassifier=javadoc


Build and Deploy the Quickstart - to OpenShift
-------------------------

### Create an OpenShift Account and Domain

If you do not yet have an OpenShift account and domain, [Sign in to OpenShift](https://openshift.redhat.com/app/login) to create the account and domain. [Get Started with OpenShift](https://openshift.redhat.com/app/getting_started) will show you how to install the OpenShift Express command line interface.

### Create the OpenShift Application

Open a shell command prompt and change to a directory of your choice. Enter the following command for quickstarts running on WildFLy 8:

rhc app create helloworldmdb https://raw.github.com/openshift-cartridges/openshift-wildfly-cartridge/master/metadata/manifest.yml

The domain name for this application will be `helloworldmdb-YOUR_DOMAIN_NAME.rhcloud.com`. Here we use the _quickstart_ domain. You will need to replace it with your own OpenShift domain name.

This command creates an OpenShift application called `helloworldmdb` and will run the application inside the `wildfly-8` container. You should see some output similar to the following:

Creating application: helloworldmdb
Now your new domain name is being propagated worldwide (this might take a minute)...
Warning: Permanently added 'helloworldmdb-quickstart.rhcloud.com,107.22.36.32' (RSA) to the list of known hosts.
Confirming application 'helloworldmdb' is available: Success!

helloworldmdb published: http://helloworldmdb-quickstart.rhcloud.com/
git url: ssh://b92047bdc05e46c980cc3501c3577c1e@helloworldmdb-quickstart.rhcloud.com/~/git/helloworldmdb.git/
Successfully created application: helloworldmdb

The create command creates a git repository in the current directory with the same name as the application. Notice that the output also reports the URL at which the application can be accessed. Make sure it is available by typing the published url <http://helloworldmdb-quickstart.rhcloud.com/> into a browser or use command line tools such as curl or wget. Be sure to replace the `quickstart` in the URL with your domain name.


### Migrate the Quickstart Source

Now that you have confirmed it is working you can migrate the quickstart source. You do not need the generated default application, so navigate to the new git repository directory and tell git to remove the source and pom files:

cd helloworldmdb
git rm -r src pom.xml

Copy the source for the `helloworld-mdb` quickstart into this new git repository:

cp -r QUICKSTART_HOME/helloworld-mdb/src .
cp QUICKSTART_HOME/helloworld-mdb/pom.xml .

### Configure the OpenShift Server

HornetQ is enabled by default in `.openshift/config/standalone.xml`. There is nothing to do to be able to send and receive messages from OpenShift.

### Deploy the OpenShift Application

You can now deploy the changes to your OpenShift application using git as follows:

git add src pom.xml .openshift
git commit -m "helloworld-mdb quickstart on OpenShift"
git push

The final push command triggers the OpenShift infrastructure to build and deploy the changes.

Note that the `openshift` profile in the `pom.xml` file is activated by OpenShift. This causes the WAR built by OpenShift to be copied to the `deployments` directory and deployed without a context path.

### Test the OpenShift Application

When the push command returns you can test the application by getting the following URL either via a browser or using tools such as curl or wget. Be sure to replace the `quickstart` in the URL with your domain name.

* <http://helloworldmdb-quickstart.rhcloud.com/> to send messages to the queue
* <http://helloworldmdb-quickstart.rhcloud.com/HelloWorldMDBServletClient?topic> to send messages to the topic

If the application has run succesfully you should see some output in the browser.

Now you can look at the output of the server by running the following command:

rhc tail -a helloworldmdb

This will show the tail of the servers log which should show something like the following.

2012/03/02 05:52:33,065 INFO [class org.jboss.as.quickstarts.mdb.HelloWorldMDB] (Thread-0 (HornetQ-client-global-threads-1772719)) Received Message from queue: This is message 4
2012/03/02 05:52:33,065 INFO [class org.jboss.as.quickstarts.mdb.HelloWorldMDB] (Thread-1 (HornetQ-client-global-threads-1772719)) Received Message from queue: This is message 1
2012/03/02 05:52:33,067 INFO [class org.jboss.as.quickstarts.mdb.HelloWorldMDB] (Thread-6 (HornetQ-client-global-threads-1772719)) Received Message from queue: This is message 5
2012/03/02 05:52:33,065 INFO [class org.jboss.as.quickstarts.mdb.HelloWorldMDB] (Thread-3 (HornetQ-client-global-threads-1772719)) Received Message from queue: This is message 3
2012/03/02 05:52:33,065 INFO [class org.jboss.as.quickstarts.mdb.HelloWorldMDB] (Thread-2 (HornetQ-client-global-threads-1772719)) Received Message from queue: This is message 2


You can use the OpenShift command line tools or the OpenShift web console to discover and control the application.

### Destroy the OpenShift Application

When you are finished with the application you can destroy it as follows:

rhc app destroy -a helloworldmdb
_Note_: There is a limit to the number of applications you can deploy concurrently to OpenShift. If the `rhc app create` command returns an error indicating you have reached that limit, you must destroy an existing application before you continue.

* To view the list of your OpenShift applications, type: `rhc domain show`
* To destroy an application, type the following, substituting the application name you want to destroy: `rhc app destroy -a APPLICATION_NAME_TO_DESTROY`

0 comments on commit 0477a52

Please sign in to comment.