pub struct DeliveryBus { /* private fields */ }Expand description
Cross-service message delivery.
Services use this to deliver messages to other services without direct dependencies between service crates. The server wires up the delivery functions at startup.
Implementations§
Source§impl DeliveryBus
impl DeliveryBus
pub fn new() -> Self
pub fn with_sqs(self, sender: Arc<dyn SqsDelivery>) -> Self
pub fn with_sns(self, sender: Arc<dyn SnsDelivery>) -> Self
pub fn with_eventbridge(self, sender: Arc<dyn EventBridgeDelivery>) -> Self
pub fn with_lambda(self, invoker: Arc<dyn LambdaDelivery>) -> Self
pub fn with_kinesis(self, sender: Arc<dyn KinesisDelivery>) -> Self
Sourcepub fn send_to_sqs(
&self,
queue_arn: &str,
message_body: &str,
attributes: &HashMap<String, String>,
)
pub fn send_to_sqs( &self, queue_arn: &str, message_body: &str, attributes: &HashMap<String, String>, )
Send a message to an SQS queue identified by ARN.
Sourcepub fn send_to_sqs_with_attrs(
&self,
queue_arn: &str,
message_body: &str,
message_attributes: &HashMap<String, SqsMessageAttribute>,
message_group_id: Option<&str>,
message_dedup_id: Option<&str>,
)
pub fn send_to_sqs_with_attrs( &self, queue_arn: &str, message_body: &str, message_attributes: &HashMap<String, SqsMessageAttribute>, message_group_id: Option<&str>, message_dedup_id: Option<&str>, )
Send a message to an SQS queue with message attributes and FIFO fields.
Sourcepub fn publish_to_sns(
&self,
topic_arn: &str,
message: &str,
subject: Option<&str>,
)
pub fn publish_to_sns( &self, topic_arn: &str, message: &str, subject: Option<&str>, )
Publish a message to an SNS topic identified by ARN.
Sourcepub fn put_event_to_eventbridge(
&self,
source: &str,
detail_type: &str,
detail: &str,
event_bus_name: &str,
)
pub fn put_event_to_eventbridge( &self, source: &str, detail_type: &str, detail: &str, event_bus_name: &str, )
Put an event onto an EventBridge bus.
Sourcepub async fn invoke_lambda(
&self,
function_arn: &str,
payload: &str,
) -> Option<Result<Vec<u8>, String>>
pub async fn invoke_lambda( &self, function_arn: &str, payload: &str, ) -> Option<Result<Vec<u8>, String>>
Invoke a Lambda function identified by ARN.
Sourcepub fn send_to_kinesis(&self, stream_arn: &str, data: &str, partition_key: &str)
pub fn send_to_kinesis(&self, stream_arn: &str, data: &str, partition_key: &str)
Put a record to a Kinesis stream identified by ARN.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for DeliveryBus
impl !RefUnwindSafe for DeliveryBus
impl Send for DeliveryBus
impl Sync for DeliveryBus
impl Unpin for DeliveryBus
impl UnsafeUnpin for DeliveryBus
impl !UnwindSafe for DeliveryBus
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more