-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e9da40f
commit 7839397
Showing
41 changed files
with
773 additions
and
743 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,40 +1,43 @@ | ||
NOTE: This project is not supported on JBoss Fuse version 6.3 or later | ||
---------------------------------------------------------------------- | ||
# CXF LB/Proxy Example | ||
|
||
CXF LB/Proxy Example | ||
================== | ||
|
||
Requirements | ||
------------ | ||
## Requirements | ||
|
||
* Apache Maven 3.x (http://maven.apache.org) | ||
* JBoss Fuse 6.x (http://jboss.org/jbossfuse) | ||
|
||
Building Example | ||
---------------- | ||
|
||
From top level of example project directory, run | ||
|
||
mvn clean install | ||
|
||
Running in JBoss Fuse | ||
--------------------- | ||
|
||
Start JBoss Fuse | ||
|
||
<JBoss Fuse Home>/bin/fuse | ||
|
||
From the JBoss Fuse console, enter the following to install the example application | ||
|
||
features:addurl mvn:org.fusebyexample.examples/lbproxy-example/1.0.0-SNAPSHOT/xml/features | ||
features:install lbproxy-example | ||
|
||
To see what is happening within the JBoss Fuse server, you can continuously view the | ||
log (tail) with the following command | ||
|
||
log:tail | ||
|
||
WS Test | ||
------------------- | ||
|
||
Use your favorite WS testing tool (ie. SoapUI) and point it to http://localhost:9090/greetingService?wsdl. Send in multiple requests and you should see it load balance/proxy to the different implementations. | ||
Build the project source code | ||
|
||
``` | ||
cd $PROJECT_ROOT | ||
mvn clean install | ||
``` | ||
|
||
## Running the example standalone (should be done in 3 separate terminal windows/tabs) | ||
|
||
``` | ||
cd $PROJECT_ROOT/greeter-gateway | ||
mvn spring-boot:run '-Dserver.port=8080' | ||
cd $PROJECT_ROOT/greeter-english-impl | ||
mvn spring-boot:run '-Dserver.port=9000' | ||
cd $PROJECT_ROOT/greeter-german-impl | ||
mvn spring-boot:run '-Dserver.port=9001' | ||
cd $PROJECT_ROOT/greeter-spanish-impl | ||
mvn spring-boot:run '-Dserver.port=9002' | ||
``` | ||
|
||
## Running the example in OpenShift | ||
|
||
``` | ||
oc new-project demo | ||
cd $PROJECT_ROOT/greeter-gateway | ||
mvn -P openshift clean install fabric8:deploy | ||
cd $PROJECT_ROOT/greeter-english-impl | ||
mvn -P openshift clean install fabric8:deploy | ||
cd $PROJECT_ROOT/greeter-german-impl | ||
mvn -P openshift clean install fabric8:deploy | ||
cd $PROJECT_ROOT/greeter-spanish-impl | ||
mvn -P openshift clean install fabric8:deploy | ||
``` | ||
|
||
## Testing the code | ||
|
||
Use your favorite WS testing tool (ie. SoapUI) and point it to http://localhost:8080/services/greeter. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: ${project.artifactId} | ||
resources: | ||
requests: | ||
cpu: "0.5" | ||
limits: | ||
cpu: "4.0" |
1 change: 0 additions & 1 deletion
1
greeter-english-impl/src/main/fabric8/org.fusebyexample.examples.lbproxy.english.properties
This file was deleted.
Oops, something went wrong.
29 changes: 29 additions & 0 deletions
29
greeter-english-impl/src/main/java/com/redhat/examples/greeter/english/Application.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* | ||
* Copyright 2016 Red Hat, Inc. | ||
* <p> | ||
* Red Hat licenses this file to you under the Apache License, version | ||
* 2.0 (the "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
* implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
* | ||
*/ | ||
package com.redhat.examples.greeter.english; | ||
|
||
import org.springframework.boot.SpringApplication; | ||
import org.springframework.boot.autoconfigure.SpringBootApplication; | ||
|
||
@SpringBootApplication | ||
public class Application { | ||
|
||
public static void main(String[] args) { | ||
|
||
SpringApplication.run(Application.class, args); | ||
} | ||
} |
36 changes: 36 additions & 0 deletions
36
...er-english-impl/src/main/java/com/redhat/examples/greeter/english/CamelConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
/* | ||
* Copyright 2016 Red Hat, Inc. | ||
* <p> | ||
* Red Hat licenses this file to you under the Apache License, version | ||
* 2.0 (the "License"); you may not use this file except in compliance | ||
* with the License. You may obtain a copy of the License at | ||
* <p> | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* <p> | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or | ||
* implied. See the License for the specific language governing | ||
* permissions and limitations under the License. | ||
* | ||
*/ | ||
package com.redhat.examples.greeter.english; | ||
|
||
import org.apache.camel.builder.RouteBuilder; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
public class CamelConfiguration extends RouteBuilder { | ||
|
||
private static final Logger log = LoggerFactory.getLogger(CamelConfiguration.class); | ||
|
||
@Override | ||
public void configure() throws Exception { | ||
|
||
from("cxf:/greeter?serviceClass=com.redhat.examples.greeter.Greeter&loggingFeatureEnabled=true") | ||
.setBody().simple("Hello ${body}!") | ||
; | ||
} | ||
} |
Oops, something went wrong.