The documentation you are viewing is for Dapr v1.10 which is an older version of Dapr. For up-to-date documentation, see the latest version.

Hazelcast

关于Hazelcast pubsub组件的详细文档。

配置

要安装 hazelcast pubsub ,请创建一个类型为 pubsub.hazelcast 的组件。 See this guide on how to create and apply a pubsub configuration.

apiVersion: dapr.io/v1alpha1
kind: Component
metadata:
  name: hazelcast-pubsub
  namespace: default
spec:
  type: pubsub.hazelcast
  version: v1
  metadata:
  - name: hazelcastServers
    value: "hazelcast:3000,hazelcast2:3000"

元数据字段规范

字段 必填 详情 Example
connectionString Y 逗号分隔的服务器地址 逗号分隔的服务器地址 示例:“hazelcast:3000,hazelcast2:3000” "hazelcast:3000,hazelcast2:3000"
backOffMaxRetries N The maximum number of retries to process the message before returning an error. Defaults to "0" which means the component will not retry processing the message. "-1" will retry indefinitely until the message is processed or the application is shutdown. And positive number is treated as the maximum retry count. The component will wait 5 seconds between retries. "3"

创建Hazelcast 实例


你可以使用Docker在本地运行Hazelcast:

docker run -e JAVA_OPTS="-Dhazelcast.local.publicAddress=127.0.0.1:5701" -p 5701:5701 hazelcast/hazelcast

然后你可以通过127.0.0.1:5701与服务器交互。


在Kubernetes上安装Hazelcast的最简单方法是使用Helm chart

相关链接