<commit_before># JGroups Azure

[![Build Status](https://travis-ci.org/jgroups-extras/jgroups-azure.svg?branch=master)](https://travis-ci.org/jgroups-extras/jgroups-azure)

Implementation of Azure ping protocol using Azure Storage blobs. Makes use of official Microsoft
Azure Java SDK.

## Configuration

### WildFly 10.1 / JBoss EAP 7.0

Since WildFly 10.1 the required modules are bundled with the distribution. Users can directly use server profile located at
`wildfly-<version>/docs/examples/configs/standalone-azure-ha.xml` or replace the discovery protocol in their existing 
server profiles with the following configuration (no need to specify module name):

```xml
<protocol type="azure.AZURE_PING">
     <property name="storage_account_name">
         ${jboss.jgroups.azure_ping.storage_account_name}
     </property>
     <property name="storage_access_key">
         ${jboss.jgroups.azure_ping.storage_access_key}
     </property>
     <property name="container">
         ${jboss.jgroups.azure_ping.container}
     </property>
</protocol>
```

### WildFly 10.0 and older

First copy the required modules (from `dist/target/wildfly-jgroups-azure-<version>/modules`) to the WildFly installation,
then replace the existing discovery protocol (PING, MPING, etc.) with the following:

```xml
<protocol type="azure.AZURE_PING" module="org.jgroups.azure">
    <property name="storage_account_name">
         ${jboss.jgroups.azure_ping.storage_account_name}
    </property>
    <property name="storage_access_key">
         ${jboss.jgroups.azure_ping.storage_access_key}
    </property>
    <property name="container">
         ${jboss.jgroups.azure_ping.container}
    </property>
 </protocol>
```

### Directly in JGroups<commit_msg>Add "Updating existing profile via CLI" section to readme<commit_after># JGroups Azure

[![Build Status](https://travis-ci.org/jgroups-extras/jgroups-azure.svg?branch=master)](https://travis-ci.org/jgroups-extras/jgroups-azure)

Implementation of Azure ping protocol using Azure Storage blobs. Makes use of official Microsoft
Azure Java SDK.

## Configuration

### WildFly 10.1 / JBoss EAP 7.0

#### Using a preconfigured profile

Since WildFly 10.1 the required modules are bundled with the distribution. Users can directly use server profile located at
`wildfly-<version>/docs/examples/configs/standalone-azure-ha.xml` or replace the discovery protocol in their existing 
server profiles with the following configuration (no need to specify module name):

```xml
<protocol type="azure.AZURE_PING">
     <property name="storage_account_name">
         ${jboss.jgroups.azure_ping.storage_account_name}
     </property>
     <property name="storage_access_key">
         ${jboss.jgroups.azure_ping.storage_access_key}
     </property>
     <property name="container">
         ${jboss.jgroups.azure_ping.container}
     </property>
</protocol>
```

#### Upgrading an existing profile via CLI

To upgrade an existing profile to use TCP stack by default and AZURE_PING protocol via CLI, start `./bin/jboss-cli.sh`
(or corresponding `bat` script on Windows) and run the following batch followed by a reload:

```
batch
/subsystem=jgroups/channel=ee:write-attribute(name=stack,value=tcp)
/subsystem=jgroups/stack=tcp/protocol=MPING:remove
/subsystem=jgroups/stack=tcp/protocol=azure.AZURE_PING:add(add-index=0,properties=[storage_account_name=${jboss.jgroups.azure_ping.storage_account_name:},storage_access_key=${jboss.jgroups.azure_ping.storage_access_key:},container=${jboss.jgroups.azure_ping.container:}])
run-batch
/:reload
```

_Note that due to issue [WFLY-6782](https://issues.jboss.org/browse/WFLY-6782) adding via CLI may fail on older versions._

### WildFly 10.0 and older

First copy the required modules (from `dist/target/wildfly-jgroups-azure-<version>/modules`) to the WildFly installation,
then replace the existing discovery protocol (PING, MPING, etc.) with the following:

```xml
<protocol type="azure.AZURE_PING" module="org.jgroups.azure">
    <property name="storage_account_name">
         ${jboss.jgroups.azure_ping.storage_account_name}
    </property>
    <property name="storage_access_key">
         ${jboss.jgroups.azure_ping.storage_access_key}
    </property>
    <property name="container">
         ${jboss.jgroups.azure_ping.container}
    </property>
 </protocol>
```

### Directly in JGroups
{'fraction_non_alphanumeric': 0.11869844179651695, 'fraction_numerical': 0.007103574702108158, 'mean_word_length': 4.66147859922179, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 5, 'lorem ipsum': 0, 'www.': 0, 'xml': 6}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1709407', 'n_tokens_mistral': 1381, 'n_tokens_neox': 1297, 'n_words': 332}