Hazelcast

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

配置

要安装 hazelcast pubsub ,请创建一个类型为 pubsub.hazelcast 的组件。 请参阅本指南,了解如何创建和应用 pubsub 配置。

  1. apiVersion: dapr.io/v1alpha1
  2. kind: Component
  3. metadata:
  4. name: hazelcast-pubsub
  5. namespace: default
  6. spec:
  7. type: pubsub.hazelcast
  8. version: v1
  9. metadata:
  10. - name: hazelcastServers
  11. value: "hazelcast:3000,hazelcast2:3000"

Warning

以上示例将 Secret 明文存储。 更推荐的方式是使用 Secret 组件, 这里

元数据字段规范

字段必填详情示例
connectionStringY逗号分隔的服务器地址 逗号分隔的服务器地址 示例:“hazelcast:3000,hazelcast2:3000”“hazelcast:3000,hazelcast2:3000”
backOffMaxRetriesNThe 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:

  1. 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

相关链接