#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlatformInboundInstruction {
#[prost(string, tag = "5")]
pub instruction_id: ::prost::alloc::string::String,
#[prost(
oneof = "platform_inbound_instruction::Request",
tags = "1, 2, 3, 4, 6"
)]
pub request: ::core::option::Option<platform_inbound_instruction::Request>,
}
pub mod platform_inbound_instruction {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Request {
#[prost(message, tag = "1")]
Register(super::ClientIdentification),
#[prost(message, tag = "2")]
EventProcessorInfo(super::EventProcessorInfo),
#[prost(message, tag = "3")]
Heartbeat(super::Heartbeat),
#[prost(message, tag = "4")]
Ack(super::super::InstructionAck),
#[prost(message, tag = "6")]
Result(super::super::InstructionResult),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlatformOutboundInstruction {
#[prost(string, tag = "12")]
pub instruction_id: ::prost::alloc::string::String,
#[prost(
oneof = "platform_outbound_instruction::Request",
tags = "1, 3, 4, 5, 6, 7, 8, 9, 10, 11"
)]
pub request: ::core::option::Option<platform_outbound_instruction::Request>,
}
pub mod platform_outbound_instruction {
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum Request {
#[prost(message, tag = "1")]
NodeNotification(super::NodeInfo),
#[prost(message, tag = "3")]
RequestReconnect(super::RequestReconnect),
#[prost(message, tag = "4")]
PauseEventProcessor(super::EventProcessorReference),
#[prost(message, tag = "5")]
StartEventProcessor(super::EventProcessorReference),
#[prost(message, tag = "6")]
ReleaseSegment(super::EventProcessorSegmentReference),
#[prost(message, tag = "7")]
RequestEventProcessorInfo(super::EventProcessorReference),
#[prost(message, tag = "8")]
SplitEventProcessorSegment(super::EventProcessorSegmentReference),
#[prost(message, tag = "9")]
MergeEventProcessorSegment(super::EventProcessorSegmentReference),
#[prost(message, tag = "10")]
Heartbeat(super::Heartbeat),
#[prost(message, tag = "11")]
Ack(super::super::InstructionAck),
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct RequestReconnect {}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct PlatformInfo {
#[prost(message, optional, tag = "1")]
pub primary: ::core::option::Option<NodeInfo>,
#[prost(bool, tag = "2")]
pub same_connection: bool,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct NodeInfo {
#[prost(string, tag = "1")]
pub host_name: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub grpc_port: i32,
#[prost(int32, tag = "3")]
pub http_port: i32,
#[prost(int32, tag = "4")]
pub version: i32,
#[prost(string, tag = "5")]
pub node_name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct ClientIdentification {
#[prost(string, tag = "1")]
pub client_id: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub component_name: ::prost::alloc::string::String,
#[prost(map = "string, string", tag = "3")]
pub tags:
::std::collections::HashMap<::prost::alloc::string::String, ::prost::alloc::string::String>,
#[prost(string, tag = "4")]
pub version: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventProcessorInfo {
#[prost(string, tag = "1")]
pub processor_name: ::prost::alloc::string::String,
#[prost(string, tag = "2")]
pub mode: ::prost::alloc::string::String,
#[prost(int32, tag = "3")]
pub active_threads: i32,
#[prost(bool, tag = "4")]
pub running: bool,
#[prost(bool, tag = "5")]
pub error: bool,
#[prost(message, repeated, tag = "6")]
pub segment_status: ::prost::alloc::vec::Vec<event_processor_info::SegmentStatus>,
#[prost(int32, tag = "7")]
pub available_threads: i32,
#[prost(string, tag = "8")]
pub token_store_identifier: ::prost::alloc::string::String,
}
pub mod event_processor_info {
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct SegmentStatus {
#[prost(int32, tag = "1")]
pub segment_id: i32,
#[prost(bool, tag = "2")]
pub caught_up: bool,
#[prost(bool, tag = "3")]
pub replaying: bool,
#[prost(int32, tag = "4")]
pub one_part_of: i32,
#[prost(int64, tag = "5")]
pub token_position: i64,
#[prost(string, tag = "6")]
pub error_state: ::prost::alloc::string::String,
}
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventProcessorReference {
#[prost(string, tag = "1")]
pub processor_name: ::prost::alloc::string::String,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct EventProcessorSegmentReference {
#[prost(string, tag = "1")]
pub processor_name: ::prost::alloc::string::String,
#[prost(int32, tag = "2")]
pub segment_identifier: i32,
}
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct Heartbeat {}
#[doc = r" Generated client implementations."]
pub mod platform_service_client {
#![allow(unused_variables, dead_code, missing_docs)]
use tonic::codegen::*;
#[doc = " Service describing operations for connecting to the AxonServer platform."]
#[doc = ""]
#[doc = "Clients are expected to use this service on any of the Platform's Admin nodes to obtain connection information of the"]
#[doc = "node that it should set up the actual connection with. On that second node, the clients should open an instruction"]
#[doc = "stream (see OpenStream), so that AxonServer and the client application can exchange information and instructions."]
pub struct PlatformServiceClient<T> {
inner: tonic::client::Grpc<T>,
}
impl PlatformServiceClient<tonic::transport::Channel> {
#[doc = r" Attempt to create a new client by connecting to a given endpoint."]
pub async fn connect<D>(dst: D) -> Result<Self, tonic::transport::Error>
where
D: std::convert::TryInto<tonic::transport::Endpoint>,
D::Error: Into<StdError>,
{
let conn = tonic::transport::Endpoint::new(dst)?.connect().await?;
Ok(Self::new(conn))
}
}
impl<T> PlatformServiceClient<T>
where
T: tonic::client::GrpcService<tonic::body::BoxBody>,
T::ResponseBody: Body + HttpBody + Send + 'static,
T::Error: Into<StdError>,
<T::ResponseBody as HttpBody>::Error: Into<StdError> + Send,
{
pub fn new(inner: T) -> Self {
let inner = tonic::client::Grpc::new(inner);
Self { inner }
}
pub fn with_interceptor(inner: T, interceptor: impl Into<tonic::Interceptor>) -> Self {
let inner = tonic::client::Grpc::with_interceptor(inner, interceptor);
Self { inner }
}
#[doc = " Obtains connection information for the Server that a Client should use for its connections. "]
pub async fn get_platform_server(
&mut self,
request: impl tonic::IntoRequest<super::ClientIdentification>,
) -> Result<tonic::Response<super::PlatformInfo>, tonic::Status> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/io.axoniq.axonserver.grpc.control.PlatformService/GetPlatformServer",
);
self.inner.unary(request.into_request(), path, codec).await
}
#[doc = " Opens an instruction stream to the Platform, allowing AxonServer to provide management instructions to the application "]
pub async fn open_stream(
&mut self,
request: impl tonic::IntoStreamingRequest<Message = super::PlatformInboundInstruction>,
) -> Result<
tonic::Response<tonic::codec::Streaming<super::PlatformOutboundInstruction>>,
tonic::Status,
> {
self.inner.ready().await.map_err(|e| {
tonic::Status::new(
tonic::Code::Unknown,
format!("Service was not ready: {}", e.into()),
)
})?;
let codec = tonic::codec::ProstCodec::default();
let path = http::uri::PathAndQuery::from_static(
"/io.axoniq.axonserver.grpc.control.PlatformService/OpenStream",
);
self.inner
.streaming(request.into_streaming_request(), path, codec)
.await
}
}
impl<T: Clone> Clone for PlatformServiceClient<T> {
fn clone(&self) -> Self {
Self {
inner: self.inner.clone(),
}
}
}
impl<T> std::fmt::Debug for PlatformServiceClient<T> {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "PlatformServiceClient {{ ... }}")
}
}
}