File tree Expand file tree Collapse file tree 4 files changed +9
-7
lines changed
Expand file tree Collapse file tree 4 files changed +9
-7
lines changed Original file line number Diff line number Diff line change @@ -50,8 +50,7 @@ async fn main() -> Result<(), pulsar::Error> {
5050 env:: var ( "PULSAR_BASIC_USERNAME" ) ,
5151 env:: var ( "PULSAR_BASIC_PASSWORD" ) ,
5252 ) {
53- builder =
54- builder. with_auth_provider ( Box :: new ( BasicAuthentication :: new ( & username, & password) ) )
53+ builder = builder. with_auth_provider ( BasicAuthentication :: new ( & username, & password) )
5554 }
5655
5756 let pulsar: Pulsar < _ > = builder. build ( ) . await ?;
Original file line number Diff line number Diff line change @@ -52,8 +52,7 @@ async fn main() -> Result<(), pulsar::Error> {
5252 env:: var ( "PULSAR_BASIC_USERNAME" ) ,
5353 env:: var ( "PULSAR_BASIC_PASSWORD" ) ,
5454 ) {
55- builder =
56- builder. with_auth_provider ( Box :: new ( BasicAuthentication :: new ( & username, & password) ) )
55+ builder = builder. with_auth_provider ( BasicAuthentication :: new ( & username, & password) )
5756 }
5857
5958 let pulsar: Pulsar < _ > = builder. build ( ) . await ?;
Original file line number Diff line number Diff line change @@ -12,10 +12,10 @@ pub struct BasicAuthentication {
1212
1313impl BasicAuthentication {
1414 #[ must_use]
15- pub fn new ( username : & str , password : & str ) -> Self {
16- Self {
15+ pub fn new ( username : & str , password : & str ) -> Box < Self > {
16+ Box :: new ( Self {
1717 auth_data : format ! ( "{username}:{password}" ) ,
18- }
18+ } )
1919 }
2020}
2121
Original file line number Diff line number Diff line change @@ -81,6 +81,9 @@ pub struct Message {
8181 pub event_time : :: std:: option:: Option < u64 > ,
8282 /// current version of the schema
8383 pub schema_version : :: std:: option:: Option < Vec < u8 > > ,
84+ /// UTC Unix timestamp in milliseconds, time at which the message should be
85+ /// delivered to consumers
86+ pub deliver_at_time : :: std:: option:: Option < i64 > ,
8487}
8588
8689/// internal message type carrying options that must be defined
@@ -126,6 +129,7 @@ impl From<Message> for ProducerMessage {
126129 replicate_to : m. replicate_to ,
127130 event_time : m. event_time ,
128131 schema_version : m. schema_version ,
132+ deliver_at_time : m. deliver_at_time ,
129133 ..Default :: default ( )
130134 }
131135 }
You can’t perform that action at this time.
0 commit comments