mattermost/server/platform/services/remotecluster
JG Heithcock 1386024013
Some checks are pending
API / build (push) Waiting to run
Server CI / Compute Go Version (push) Waiting to run
Server CI / Check mocks (push) Blocked by required conditions
Server CI / Check go mod tidy (push) Blocked by required conditions
Server CI / check-style (push) Blocked by required conditions
Server CI / Check serialization methods for hot structs (push) Blocked by required conditions
Server CI / Vet API (push) Blocked by required conditions
Server CI / Check migration files (push) Blocked by required conditions
Server CI / Generate email templates (push) Blocked by required conditions
Server CI / Check store layers (push) Blocked by required conditions
Server CI / Check mmctl docs (push) Blocked by required conditions
Server CI / Postgres with binary parameters (push) Blocked by required conditions
Server CI / Postgres (push) Blocked by required conditions
Server CI / Postgres (FIPS) (push) Blocked by required conditions
Server CI / Generate Test Coverage (push) Blocked by required conditions
Server CI / Run mmctl tests (push) Blocked by required conditions
Server CI / Run mmctl tests (FIPS) (push) Blocked by required conditions
Server CI / Build mattermost server app (push) Blocked by required conditions
Web App CI / check-lint (push) Waiting to run
Web App CI / check-i18n (push) Waiting to run
Web App CI / check-types (push) Waiting to run
Web App CI / test (push) Waiting to run
Web App CI / build (push) Waiting to run
Fix MM-65152 (#34199)
2025-10-29 07:52:34 -07:00
..
error.go Return an error if an invite for a confirmed remote cluster is received (#28943) 2024-10-25 11:30:29 +02:00
invitation.go MM-64522: Use PBKDF2 as the new key derivation for remote cluster invitation (#33493) 2025-07-21 19:08:31 +05:30
mocks_test.go Fix MM-65152 (#34199) 2025-10-29 07:52:34 -07:00
ping.go [MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00
ping_test.go Fix flaky ping test for remote clusters service (#26821) 2024-04-22 17:33:37 +02:00
README.md add readme to the remotecluster and sharedchannel service directories (#30123) 2025-02-26 19:35:54 +01:00
recv.go Fix MM-65152 (#34199) 2025-10-29 07:52:34 -07:00
recv_test.go Fix MM-65152 (#34199) 2025-10-29 07:52:34 -07:00
response.go Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
send.go Mono repo -> Master (#22553) 2023-03-22 17:22:27 -04:00
send_test.go [MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00
sendfile.go Metrics for shared channels (#26199) 2024-02-21 17:21:35 -05:00
sendmsg.go Adds Remote Cluster related API endpoints (#27432) 2024-07-04 10:35:26 +02:00
sendprofileImage.go Metrics for shared channels (#26199) 2024-02-21 17:21:35 -05:00
sendprofileImage_test.go [MM-64654] Migrate to modern Go features (#31820) 2025-07-18 12:54:51 +02:00
service.go MM-52600: [Shared Channels] Shared channels do not sync channel membership (#30976) 2025-06-15 10:07:56 +02:00
service_test.go Shared channels plugin APIs for MS Teams plugin (#25805) 2023-12-22 17:00:27 -05:00

Remote Cluster Service

Package remotecluster implements Mattermost's "Secured Connections" feature, which enables communication between different Mattermost clusters. Specifically, this package provides:

Service Management:

  • Manages inter-cluster communication via topic-based messages
  • Handles connection state (active/inactive) based on cluster leadership
  • Maintains concurrent send channels (MaxConcurrentSends = 10) for parallel message processing
  • Implements periodic health checks (pings) to monitor remote cluster connectivity

Message Handling:

  • Sends messages using a pool of goroutines to handle concurrent sends while preserving message order per remote
  • Uses hash-based routing to ensure messages for the same remote ID go to the same channel
  • Supports different types of sends: messages, files, and profile images
  • Implements topic-based message routing with listener callbacks

Connection Management:

  • Handles invitation confirmations between clusters
  • Maintains HTTP client connections with proper timeouts and transport settings
  • Supports connection state listeners for monitoring remote cluster availability
  • Implements ping mechanism to verify remote cluster health

Core Features:

  • Topic-based message routing
  • File transfer capabilities
  • Profile image synchronization
  • Invitation system for establishing connections
  • Health monitoring via pings
  • Concurrent message processing
  • Connection state management

This package is designed to be thread-safe and handles leadership changes in clustered environments, only running active operations on the leader node.