Skip to content

Commit

Permalink
Updates tyrus-standalone-client version from 1.17 to 1.19 in the do…
Browse files Browse the repository at this point in the history
…cumentations (slackapi#1012)

* Replace javax.websocket-api and tyrus-standalone-client versions by variables in documentation

A few trailing whitespaces were automatically trimmed and a few final new lines were automatically added. This is not a neutral change so it has not been reverted.

* Update tyrus-standalone-client from 1.17 to 1.19 in docs

tyrus-standalone-client 1.19 is still compatible with bolt-socket-mode, but supports officially Java 17 and contains various bug fixes and improvements. See https://projects.eclipse.org/projects/ee4j.tyrus/tyrus-standalone-client.
  • Loading branch information
marcwrobel authored Jul 8, 2022
1 parent 03fc259 commit 8f9e31b
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 40 deletions.
2 changes: 2 additions & 0 deletions docs/_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,5 @@ springBootVersion: 2.7.1
compatibleMicronautVersion: 3.x
quarkusVersion: 2.10.2.Final
helidonVersion: 2.5.0
javaxWebsocketApiVersion: 1.1
tyrusStandaloneClientVersion: 1.19
16 changes: 8 additions & 8 deletions docs/guides/getting-started-with-bolt-socket-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ After you [create your Maven project](https://maven.apache.org/guides/getting-st
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<version>1.1</version>
<version>{{ site.javaxWebsocketApiVersion }}</version>
</dependency>
<dependency>
<groupId>org.glassfish.tyrus.bundles</groupId>
<artifactId>tyrus-standalone-client</artifactId>
<version>1.17</version>
<version>{{ site.tyrusStandaloneClientVersion }}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down Expand Up @@ -87,8 +87,8 @@ After you [create your Gradle project](https://docs.gradle.org/current/samples/s
```groovy
dependencies {
implementation("com.slack.api:bolt-socket-mode:{{ site.sdkLatestVersion }}")
implementation("javax.websocket:javax.websocket-api:1.1")
implementation("org.glassfish.tyrus.bundles:tyrus-standalone-client:1.17")
implementation("javax.websocket:javax.websocket-api:{{ site.javaxWebsocketApiVersion }}")
implementation("org.glassfish.tyrus.bundles:tyrus-standalone-client:{{ site.tyrusStandaloneClientVersion }}")
implementation("org.slf4j:slf4j-simple:{{ site.slf4jApiVersion }}")
}
```
Expand All @@ -113,8 +113,8 @@ repositories {
}
dependencies {
implementation("com.slack.api:bolt-socket-mode:{{ site.sdkLatestVersion }}")
implementation("javax.websocket:javax.websocket-api:1.1")
implementation("org.glassfish.tyrus.bundles:tyrus-standalone-client:1.17")
implementation("javax.websocket:javax.websocket-api:{{ site.javaxWebsocketApiVersion }}")
implementation("org.glassfish.tyrus.bundles:tyrus-standalone-client:{{ site.tyrusStandaloneClientVersion }}")
implementation("org.slf4j:slf4j-simple:{{ site.slf4jApiVersion }}")
}
application {
Expand Down Expand Up @@ -249,8 +249,8 @@ dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("com.slack.api:bolt-socket-mode:{{ site.sdkLatestVersion }}")
implementation("javax.websocket:javax.websocket-api:1.1")
implementation("org.glassfish.tyrus.bundles:tyrus-standalone-client:1.17")
implementation("javax.websocket:javax.websocket-api:{{ site.javaxWebsocketApiVersion }}")
implementation("org.glassfish.tyrus.bundles:tyrus-standalone-client:{{ site.tyrusStandaloneClientVersion }}")
implementation("org.slf4j:slf4j-simple:{{ site.slf4jApiVersion }}") // or logback-classic
}
application {
Expand Down
16 changes: 8 additions & 8 deletions docs/guides/ja/getting-started-with-bolt-socket-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ lang: ja
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<version>1.1</version>
<version>{{ site.javaxWebsocketApiVersion }}</version>
</dependency>
<dependency>
<groupId>org.glassfish.tyrus.bundles</groupId>
<artifactId>tyrus-standalone-client</artifactId>
<version>1.17</version>
<version>{{ site.tyrusStandaloneClientVersion }}</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down Expand Up @@ -88,8 +88,8 @@ Gralde プロジェクトを作成した後 **bolt** 関連の依存ライブラ
dependencies {
implementation("com.slack.api:bolt:{{ site.sdkLatestVersion }}")
implementation("com.slack.api:bolt-socket-mode:{{ site.sdkLatestVersion }}")
implementation("javax.websocket:javax.websocket-api:1.1")
implementation("org.glassfish.tyrus.bundles:tyrus-standalone-client:1.17")
implementation("javax.websocket:javax.websocket-api:{{ site.javaxWebsocketApiVersion }}")
implementation("org.glassfish.tyrus.bundles:tyrus-standalone-client:{{ site.tyrusStandaloneClientVersion }}")
implementation("org.slf4j:slf4j-simple:{{ site.slf4jApiVersion }}")
}
```
Expand All @@ -114,8 +114,8 @@ repositories {
}
dependencies {
implementation("com.slack.api:bolt-socket-mode:{{ site.sdkLatestVersion }}")
implementation("javax.websocket:javax.websocket-api:1.1")
implementation("org.glassfish.tyrus.bundles:tyrus-standalone-client:1.17")
implementation("javax.websocket:javax.websocket-api:{{ site.javaxWebsocketApiVersion }}")
implementation("org.glassfish.tyrus.bundles:tyrus-standalone-client:{{ site.tyrusStandaloneClientVersion }}")
implementation("org.slf4j:slf4j-simple:{{ site.slf4jApiVersion }}")
}
application {
Expand Down Expand Up @@ -250,8 +250,8 @@ dependencies {
implementation(platform("org.jetbrains.kotlin:kotlin-bom"))
implementation("org.jetbrains.kotlin:kotlin-stdlib-jdk8")
implementation("com.slack.api:bolt-socket-mode:{{ site.sdkLatestVersion }}")
implementation("javax.websocket:javax.websocket-api:1.1")
implementation("org.glassfish.tyrus.bundles:tyrus-standalone-client:1.17")
implementation("javax.websocket:javax.websocket-api:{{ site.javaxWebsocketApiVersion }}")
implementation("org.glassfish.tyrus.bundles:tyrus-standalone-client:{{ site.tyrusStandaloneClientVersion }}")
implementation("org.slf4j:slf4j-simple:{{ site.slf4jApiVersion }}") // または logback-classic など
}
application {
Expand Down
6 changes: 3 additions & 3 deletions docs/guides/ja/rtm.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ RTM クライアントを使うためには、**slack-api-client** ライブラ
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<version>1.1</version>
<version>{{ site.javaxWebsocketApiVersion }}</version>
</dependency>
<dependency>
<groupId>org.glassfish.tyrus.bundles</groupId>
<artifactId>tyrus-standalone-client</artifactId>
<version>1.17</version>
<version>{{ site.tyrusStandaloneClientVersion }}</version>
</dependency>
</dependencies>
</project>
Expand Down Expand Up @@ -98,4 +98,4 @@ rtm.reconnect();

// Slack との接続を切断 - #close() メソッドもこれを呼び出します
rtm.disconnect();
```
```
16 changes: 8 additions & 8 deletions docs/guides/ja/socket-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ lang: ja
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<version>1.1</version>
<version>{{ site.javaxWebsocketApiVersion }}</version>
</dependency>
<dependency>
<groupId>org.glassfish.tyrus.bundles</groupId>
<artifactId>tyrus-standalone-client</artifactId>
<version>1.17</version>
<version>{{ site.tyrusStandaloneClientVersion }}</version>
</dependency>
</dependencies>
</project>
Expand Down Expand Up @@ -110,7 +110,7 @@ String appToken = System.getenv("SLACK_APP_TOKEN");
SocketModeApp socketModeApp = new SocketModeApp(appToken, app);

// #start() メソッドは WebSocket コネクションを確立して、カレントスレッドをブロックし続けます。
// ブロックしたくない場合は #startAsync() を使ってください。
// ブロックしたくない場合は #startAsync() を使ってください。
socketModeApp.start();
```

Expand Down Expand Up @@ -186,11 +186,11 @@ try (SocketModeClient client = Slack.getInstance().socketMode(appLevelToken)) {
client.addWebSocketMessageListener((String message) -> {
// TODO: WebSocket のテキストメッセージを使って何かする
});

client.addWebSocketErrorListener((Throwable reason) -> {
// TODO: 例外を処理する
});

// type: events のエンベロープだけを受け取るリスナーを追加
client.addEventsApiEnvelopeListener((EventsApiEnvelope envelope) -> {
// TODO: Events API のペイロードを使って何ややる
Expand All @@ -199,11 +199,11 @@ try (SocketModeClient client = Slack.getInstance().socketMode(appLevelToken)) {
SocketModeResponse ack = AckResponse.builder().envelopeId(envelope.getEnvelopeId()).build();
client.sendSocketModeResponse(ack);
});

client.connect(); // ソケットモードサーバーに接続してメッセージの受信を開始

client.disconnect(); // ソケットモードサーバーから切断

client.connectToNewEndpoint(); // 新しい WSS URL を発行して、その URL に接続
}
```
```
6 changes: 3 additions & 3 deletions docs/guides/rtm.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ To use the RTM Client, in addition to the **slack-api-client** library, **javax.
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<version>1.1</version>
<version>{{ site.javaxWebsocketApiVersion }}</version>
</dependency>
<dependency>
<groupId>org.glassfish.tyrus.bundles</groupId>
<artifactId>tyrus-standalone-client</artifactId>
<version>1.17</version>
<version>{{ site.tyrusStandaloneClientVersion }}</version>
</dependency>
</dependencies>
</project>
Expand Down Expand Up @@ -99,4 +99,4 @@ rtm.reconnect();

// Disconnect from Slack - #close() method does the same
rtm.disconnect();
```
```
20 changes: 10 additions & 10 deletions docs/guides/socket-mode.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,12 @@ To manage the Socket Mode connections, in addition to the **bolt-socket-mode** l
<dependency>
<groupId>javax.websocket</groupId>
<artifactId>javax.websocket-api</artifactId>
<version>1.1</version>
<version>{{ site.javaxWebsocketApiVersion }}</version>
</dependency>
<dependency>
<groupId>org.glassfish.tyrus.bundles</groupId>
<artifactId>tyrus-standalone-client</artifactId>
<version>1.17</version>
<version>{{ site.tyrusStandaloneClientVersion }}</version>
</dependency>
</dependencies>
</project>
Expand Down Expand Up @@ -106,12 +106,12 @@ import com.slack.api.bolt.socket_mode.SocketModeApp;
// the app-level token with `connections:write` scope
String appToken = System.getenv("SLACK_APP_TOKEN");

// Initialize the adapter for Socket Mode
// Initialize the adapter for Socket Mode
// with an app-level token and your Bolt app with listeners.
SocketModeApp socketModeApp = new SocketModeApp(appToken, app);

// #start() method establishes a new WebSocket connection and then blocks the current thread.
// If you do not want to block this thread, use #startAsync() instead.
// If you do not want to block this thread, use #startAsync() instead.
socketModeApp.start();
```

Expand All @@ -122,7 +122,7 @@ import com.slack.api.bolt.App;
import com.slack.api.bolt.AppConfig;
import com.slack.api.model.event.AppMentionEvent;

// As this is a distributed Socket Mode app,
// As this is a distributed Socket Mode app,
// you do not need a token for a specific workspace and the signing secret here.
AppConfig appConfig = AppConfig.builder()
.clientId("111.222")
Expand Down Expand Up @@ -187,11 +187,11 @@ try (SocketModeClient client = Slack.getInstance().socketMode(appLevelToken)) {
client.addWebSocketMessageListener((String message) -> {
// TODO: Do something with the raw WebSocket text message
});

client.addWebSocketErrorListener((Throwable reason) -> {
// TODO: Do something with a thrown exception
});

// Add a listener function that handles only type: events envelopes
client.addEventsApiEnvelopeListener((EventsApiEnvelope envelope) -> {
// TODO: Do something with an Events API payload
Expand All @@ -200,11 +200,11 @@ try (SocketModeClient client = Slack.getInstance().socketMode(appLevelToken)) {
SocketModeResponse ack = AckResponse.builder().envelopeId(envelope.getEnvelopeId()).build();
client.sendSocketModeResponse(ack);
});

client.connect(); // Start receiving messages from the Socket Mode server

client.disconnect(); // Disconnect from the server

client.connectToNewEndpoint(); // Issue a new WSS URL and connects to the URL
}
```
```

0 comments on commit 8f9e31b

Please sign in to comment.