Skip to content
This repository was archived by the owner on May 16, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ The sample applications specify a dependency on a Solace Messaging service insta

### Building

Just clone and build. For example:
Just clone and build. For example:

1. clone this GitHub repository
1. `./gradlew build`
Expand Down Expand Up @@ -66,12 +66,12 @@ The easiest way for applications to access the SolaceServiceCredentials object i
CloudFactory cloudFactory = new CloudFactory();
Cloud cloud = cloudFactory.getCloud();
SolaceServiceCredentials solaceServiceCredentials = (SolaceServiceCredentials) cloud.getServiceInfo("MyService");

Alternatively applications could search through the environment and discover matching services as follows:

SolaceServiceCredentials solaceServiceCredentials = null;
List<ServiceInfo> services = cloud.getServiceInfos();

// Connect to the first Solace-Messaging service that is found in the services list.
for (ServiceInfo service : services) {
if (service instanceof SolaceServiceCredentials) {
Expand All @@ -96,7 +96,7 @@ Transport Level Security (TLS) between the Java application and the Solace Messa

## LDAP

This is not a standalone application, but instead a modification to the existing sample apps.
This is not a standalone application, but instead a modification to the existing sample apps.

If application access is enabled by the cloud operator, bindings will not contain application access credentials and the credentials will instead have to be provided to the application externally.

Expand Down Expand Up @@ -128,7 +128,7 @@ The message is received asynchronously, check for the last message.

Unsubscribe the application from topic "test"

curl -X DELETE -H "Content-Type: application/json;charset=UTF-8" -d '{"subscription": "test"}' http://$APP_URL/subscription
curl -X DELETE http://$APP_URL/subscription/test

## Contributing

Expand Down
16 changes: 8 additions & 8 deletions docs/_tutorials/java-app.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ compile("com.solacesystems:sol-jcsmp:{{ site.jcsmp_version }}")

### Get the API: Using the Solace Developer Portal

The Java API library can be [downloaded here]({{ site.links-downloads }}). The Java API is distributed as a zip file containing the required jars, API documentation, and examples.
The Java API library can be [downloaded here]({{ site.links-downloads }}). The Java API is distributed as a zip file containing the required jars, API documentation, and examples.

## Code Walk Through

Expand All @@ -74,7 +74,7 @@ This tutorial will only cover the source code in `SolaceController.java` as the

### Obtaining the Solace Credentials in the Application

The Pivotal Cloud Foundry environment exposes any bound Service Instances in a JSON document stored in the `VCAP_SERVICES` environment variable. Here is an example of a VCAP_SERVICES with all the fields of interest to us:
The Pivotal Cloud Foundry environment exposes any bound Service Instances in a JSON document stored in the `VCAP_SERVICES` environment variable. Here is an example of a VCAP_SERVICES with all the fields of interest to us:

```
{
Expand Down Expand Up @@ -154,8 +154,8 @@ Once the credentials are extracted, you can create and then connect the Solace S

```java

// The host property is in a json array. Two hosts are provided in a High Availability
// environment, one for the primary router and one for the backup.
// The host property is in a json array. Two hosts are provided in a High Availability
// environment, one for the primary router and one for the backup.
JSONArray hostsArray = solaceCredentials.getJSONArray("smfHosts");
String host = hostsArray.getString(0);

Expand Down Expand Up @@ -240,7 +240,7 @@ public ResponseEntity<String> sendMessage(@RequestBody SimpleMessage message) {
```

Receiving messages is done at the backend via the `SimpleMessageListener` listener described above. This sample stores the last message received. To access ths received message you can send a `GET` request to `/message` endpoint. The same JSON structure of a message will be returned in the payload of the `GET`.

```java
@RequestMapping(value = "/message", method = RequestMethod.GET)
public ResponseEntity<SimpleMessage> getLastMessageReceived() {
Expand All @@ -258,7 +258,7 @@ The full source code for this example is available in [GitHub]({{ site.repositor

```
git clone {{ site.repository }}
cd {{ site.baseurl | remove: '/'}}
cd {{ site.baseurl | remove: '/'}}
./gradlew build
```

Expand Down Expand Up @@ -311,7 +311,7 @@ curl -X POST -H "Content-Type: application/json;charset=UTF-8" -d '{"topic": "te
curl -X GET http://$APP_URL/message

# Unsubscribe the application from the topic "test"
curl -X DELETE -H "Content-Type: application/json;charset=UTF-8" -d '{"subscription": "test"}' http://$APP_URL/subscription
curl -X DELETE http://$APP_URL/subscription/test
```
## High Availability

Expand All @@ -333,7 +333,7 @@ In order to provide both hosts to the Solace Java API, you need to create a stri

```
// The host property is in a json array. Two hosts are provided in a High Availability
// environment, one for the primary router and one for the backup.
// environment, one for the primary router and one for the backup.
JSONArray hostsArray = solaceCredentials.getJSONArray("smfHosts");
String primary = hostsArray.getString(0);
String backup = hostsArray.getString(1);
Expand Down
12 changes: 6 additions & 6 deletions docs/_tutorials/secure-session.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ This tutorial assumes the following:

## Working with a Trusted Certificate

In order to use Transport Level Security, your Solace Message Router needs to be configured for TLS with an installed servcer certificate.
The instructions for doing that are described in the Pivotal/Solace Messaging documentation -
see [Tile Installation and Configuration]({{ site.links-ext-tls-server }}){:target="_blank"},
In order to use Transport Level Security, your Solace Message Router needs to be configured for TLS with an installed servcer certificate.
The instructions for doing that are described in the Pivotal/Solace Messaging documentation -
see [Tile Installation and Configuration]({{ site.links-ext-tls-server }}){:target="_blank"},
look for the step named Configure Message Routers RSA certificate.

This section assumes that you have a Solace Messaging Service Instance properly configured for TLS access with a certificate that has been purchased from a certificate authority. Instructions for working with self-signed certificates are below.
Expand Down Expand Up @@ -93,7 +93,7 @@ properties.setproperty(JCSMPProperties.SSL_VALIDATE_CERTIFICATE, true);
properties.setproperty(JCSMPProperties.SSL_VALIDATE_CERTIFICATE_DATE, true);
```

When you set `INSTALL_CERTIFICATE` to `true`, it instructs the SolaceController class to install the certificate in the JRE's trusted store before trying to connect to the service.
When you set `INSTALL_CERTIFICATE` to `true`, it instructs the SolaceController class to install the certificate in the JRE's trusted store before trying to connect to the service.

The way it works is this. When you copy the certificate into the src/main/resources file, it gets packaged with the application. The application can then read the file from its local file system at runtime.

Expand All @@ -114,7 +114,7 @@ The full source code for this example is available in [GitHub]({{ site.repositor

```
git clone {{ site.repository }}
cd {{ site.baseurl | remove: '/'}}
cd {{ site.baseurl | remove: '/'}}
./gradlew build
```

Expand Down Expand Up @@ -167,7 +167,7 @@ curl -X POST -H "Content-Type: application/json;charset=UTF-8" -d '{"topic": "te
curl -X GET http://$APP_URL/message

# Unsubscribe the application from the topic "test"
curl -X DELETE -H "Content-Type: application/json;charset=UTF-8" -d '{"subscription": "test"}' http://$APP_URL/subscription
curl -X DELETE http://$APP_URL/subscription/test
```

## Common Problems
Expand Down
12 changes: 6 additions & 6 deletions docs/_tutorials/spring-cloud-autoconf-java.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ compile("com.solacesystems:sol-jcsmp:{{ site.jcsmp_version }}")

### Get the API: Using the Solace Developer Portal

The Java API library can be [downloaded here]({{ site.links-downloads }}). The Java API is distributed as a zip file containing the required jars, API documentation, and examples.
The Java API library can be [downloaded here]({{ site.links-downloads }}). The Java API is distributed as a zip file containing the required jars, API documentation, and examples.

## Code Walk Through

Expand All @@ -78,7 +78,7 @@ This tutorial will only cover the source code in `SolaceController.java` and the

### Obtaining the Solace Credentials in the Application

The Pivotal Cloud Foundry environment exposes any bound Service Instances in a JSON document stored in the `VCAP_SERVICES` environment variable. Here is an example of a VCAP_SERVICES with all the fields of interest to us:
The Pivotal Cloud Foundry environment exposes any bound Service Instances in a JSON document stored in the `VCAP_SERVICES` environment variable. Here is an example of a VCAP_SERVICES with all the fields of interest to us:

```
{
Expand Down Expand Up @@ -106,7 +106,7 @@ The Pivotal Cloud Foundry environment exposes any bound Service Instances in a J

You can see the full structure of the Solace Messaging `VCAP_SERVICES` in the [Solace Messaging for PCF documentation]({{ site.links-ext-vcap }}){:target="_blank"}.

This sample uses the [solace-java-spring-boot]({{ site.links-ext-github-sp-solace-java-spring-boot }}){:target="_blank"} which can auto detect and auto wire the available Solace Messaging Services from the Cloud Foundry environment into your application.
This sample uses the [solace-java-spring-boot]({{ site.links-ext-github-sp-solace-java-spring-boot }}){:target="_blank"} which can auto detect and auto wire the available Solace Messaging Services from the Cloud Foundry environment into your application.

Spring provided `@Autowire` is used to access all auto configuration available beans which include an auto selected Factory.

Expand Down Expand Up @@ -231,7 +231,7 @@ public ResponseEntity<String> sendMessage(@RequestBody SimpleMessage message) {
```

Receiving messages is done at the backend via the `SimpleMessageListener` listener described above. This sample stores the last message received. To access ths received message you can send a `GET` request to `/message` endpoint. The same JSON structure of a message will be returned in the payload of the `GET`.

```java
@RequestMapping(value = "/message", method = RequestMethod.GET)
public ResponseEntity<SimpleMessage> getLastMessageReceived() {
Expand All @@ -249,7 +249,7 @@ The full source code for this example is available in [GitHub]({{ site.repositor

```
git clone {{ site.repository }}
cd {{ site.baseurl | remove: '/'}}
cd {{ site.baseurl | remove: '/'}}
./gradlew build
```

Expand Down Expand Up @@ -315,5 +315,5 @@ curl -X POST -H "Content-Type: application/json;charset=UTF-8" -d '{"topic": "te
curl -X GET http://$APP_URL/message

# Unsubscribe the application from the topic "test"
curl -X DELETE -H "Content-Type: application/json;charset=UTF-8" -d '{"subscription": "test"}' http://$APP_URL/subscription
curl -X DELETE http://$APP_URL/subscription/test
```
12 changes: 6 additions & 6 deletions docs/_tutorials/spring-cloud-autoconf-jms.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ compile("com.solacesystems:sol-jms:${solaceJMSVersion}")

### Get the API: Using the Solace Developer Portal

The JMS API library can be [downloaded here]({{ site.links-downloads }}). The JMS API is distributed as a zip file containing the required jars, API documentation, and examples.
The JMS API library can be [downloaded here]({{ site.links-downloads }}). The JMS API is distributed as a zip file containing the required jars, API documentation, and examples.

## Code Walk Through

Expand All @@ -79,7 +79,7 @@ This tutorial will only cover the source code in `SolaceController.java`, and `P

### Obtaining the Solace Credentials in the Application

The Pivotal Cloud Foundry environment exposes any bound Service Instances in a JSON document stored in the `VCAP_SERVICES` environment variable. Here is an example of a VCAP_SERVICES with all the fields of interest to us:
The Pivotal Cloud Foundry environment exposes any bound Service Instances in a JSON document stored in the `VCAP_SERVICES` environment variable. Here is an example of a VCAP_SERVICES with all the fields of interest to us:

```
{
Expand Down Expand Up @@ -158,7 +158,7 @@ This Spring Cloud Auto-Config JMS sample app is making use of Spring JMS for mes

### Creating the Message Producer and Consumer

The `ConnectionFactory connectionFactory` has been already autowired, which is the Solace implementation of the standard JMS ConnectionFactory interface, instantiated to access the Solace Messaging service.
The `ConnectionFactory connectionFactory` has been already autowired, which is the Solace implementation of the standard JMS ConnectionFactory interface, instantiated to access the Solace Messaging service.

The following code is used for a simple message producer:

Expand Down Expand Up @@ -258,7 +258,7 @@ public ResponseEntity<String> sendMessage(@RequestBody SimpleMessage message) {
```

Receiving messages is done at the backend via the `SimpleMessageListener` listener described above. This sample stores the last message received. To access ths received message you can send a `GET` request to `/message` endpoint. The same JSON structure of a message will be returned in the payload of the `GET`.

```java
@RequestMapping(value = "/message", method = RequestMethod.GET)
public ResponseEntity<SimpleMessage> getLastMessageReceived() {
Expand All @@ -276,7 +276,7 @@ The full source code for this example is available in [GitHub]({{ site.repositor

```
git clone {{ site.repository }}
cd {{ site.baseurl | remove: '/'}}
cd {{ site.baseurl | remove: '/'}}
./gradlew build
```

Expand Down Expand Up @@ -343,5 +343,5 @@ curl -X POST -H "Content-Type: application/json;charset=UTF-8" -d '{"topic": "te
curl -X GET http://$APP_URL/message

# Unsubscribe the application from the topic "test"
curl -X DELETE -H "Content-Type: application/json;charset=UTF-8" -d '{"subscription": "test"}' http://$APP_URL/subscription
curl -X DELETE http://$APP_URL/subscription/test
```
22 changes: 11 additions & 11 deletions docs/_tutorials/spring-cloud-autoconf-jndi.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ compile("com.solacesystems:sol-jms:${solaceJMSVersion}")

### Get the API: Using the Solace Developer Portal

The JMS API library can be [downloaded here]({{ site.links-downloads }}). The JMS API is distributed as a zip file containing the required jars, API documentation, and examples.
The JMS API library can be [downloaded here]({{ site.links-downloads }}). The JMS API is distributed as a zip file containing the required jars, API documentation, and examples.

## Code Walk Through

Expand All @@ -80,7 +80,7 @@ This tutorial will only cover the source code in `SolaceController.java`, `JndiC

### Obtaining the Solace Credentials in the Application

The Pivotal Cloud Foundry environment exposes any bound Service Instances in a JSON document stored in the `VCAP_SERVICES` environment variable. Here is an example of a VCAP_SERVICES with all the fields of interest to us:
The Pivotal Cloud Foundry environment exposes any bound Service Instances in a JSON document stored in the `VCAP_SERVICES` environment variable. Here is an example of a VCAP_SERVICES with all the fields of interest to us:

```
{
Expand Down Expand Up @@ -159,7 +159,7 @@ This Spring Cloud Auto-Config JMS sample app is making use of Spring JMS for mes

### Creating the Message Producer and Consumer

The `JmsTemplate jmsTemplate` has been already autowired, which includes the details for the Solace Messaging service.
The `JmsTemplate jmsTemplate` has been already autowired, which includes the details for the Solace Messaging service.

The following code is used for a simple message producer:

Expand All @@ -177,13 +177,13 @@ public class JndiProducerConfiguration {
// Use from the jndi connection config
@Autowired
private JndiTemplate jndiTemplate;

@Bean
public JndiObjectFactoryBean connectionFactory() {
JndiObjectFactoryBean factoryBean = new JndiObjectFactoryBean();
factoryBean.setJndiTemplate(jndiTemplate);
factoryBean.setJndiName(connectionFactoryJndiName);

return factoryBean;
}

Expand All @@ -202,7 +202,7 @@ public class JndiProducerConfiguration {
jdr.setJndiTemplate(jndiTemplate);
return jdr;
}

@Bean
public JmsTemplate producerJmsTemplate() {
JmsTemplate jt = new JmsTemplate(cachingConnectionFactory());
Expand Down Expand Up @@ -238,7 +238,7 @@ public class JndiConsumerConfiguration {

@Autowired
JndiTemplate jndiTemplate;


@Bean
public JndiObjectFactoryBean connectionFactory() {
Expand All @@ -247,7 +247,7 @@ public class JndiConsumerConfiguration {
factoryBean.setJndiName(connectionFactoryJndiName);
return factoryBean;
}

// DynamicDestinationResolver can be used instead for physical, non-jndi destinations
@Bean
public JndiDestinationResolver jndiDestinationResolver() {
Expand Down Expand Up @@ -327,7 +327,7 @@ public ResponseEntity<String> sendMessage(@RequestBody SimpleMessage message) {
```

Receiving messages is done at the backend via the `SimpleMessageListener` listener described above. This sample stores the last message received. To access ths received message you can send a `GET` request to `/message` endpoint. The same JSON structure of a message will be returned in the payload of the `GET`.

```java
@RequestMapping(value = "/message", method = RequestMethod.GET)
public ResponseEntity<SimpleMessage> getLastMessageReceived() {
Expand All @@ -345,7 +345,7 @@ The full source code for this example is available in [GitHub]({{ site.repositor

```
git clone {{ site.repository }}
cd {{ site.baseurl | remove: '/'}}
cd {{ site.baseurl | remove: '/'}}
./gradlew build
```

Expand Down Expand Up @@ -417,5 +417,5 @@ curl -X POST -H "Content-Type: application/json;charset=UTF-8" -d '{"topic": "te
curl -X GET http://$APP_URL/message

# Unsubscribe the application from the topic "test"
curl -X DELETE -H "Content-Type: application/json;charset=UTF-8" -d '{"subscription": "test"}' http://$APP_URL/subscription
curl -X DELETE http://$APP_URL/subscription/test
```
Loading