Coder Social home page Coder Social logo

fe2o3-amqp's People

Contributors

larryosterman avatar levyks avatar minghuaw avatar rokeller avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

fe2o3-amqp's Issues

MessageDecodeError when non-empty map sections are included in the message

Message {
  header: Some(Header { durable: true, ..Default::default() }),
  delivery_annotations: Some(DeliveryAnnotations::builder().insert("key", 1u32).build()),
  message_annotations: Some(MessageAnnotations::builder().insert("key2", "v").build()),
  properties: Some(Properties::builder().message_id(1u64).build()),
  application_properties: Some(ApplicationProperties::builder().insert("sn", 1i32).build()),
  body: Body::Value(AmqpValue(Value::Bool(true))),
  footer: None,
}

This will give a deserialization error

Immediately detach when rejecting incoming attach

End of page 49

Note that if the application chooses not to create a terminus, the session endpoint will still create a link endpoint and issue an attach indicating that the link endpoint has no associated local terminus. In this case, the session endpoint MUST immediately detach the newly created link endpoint.

Detach control link when transaction retire is associated with multiple txn-id

The delivery itself need not be associated with the same transaction as the outcome, or indeed with any transaction at all. However, the delivery MUST NOT be associated with a different non-discharged transaction than the outcome. If this happens then the control link MUST be terminated with a transaction-rollback error

Remove type state from Sender and Receiver

Because the state of the link is controlled by both the sender and receiver, it is impossible to determine the state at the compile time, and thus type state, which only makes sense if state can be known at compile time, doesn't make sense either. Thus the type state will be removed from sender and receiver

How should sender respond to remote detach

Problem

The current implementation detects remote detach frame when the Sender is attempting to send anything. This works fine except when the remote peer is expecting an immediate detach response while the local Sender is not sending or going to send anything in the near future.

Proposed solution?

Move handling of the remote detach to Sender's LinkRelay?

Listener API design

Overall objective:

  1. The listener API should more or less resemble that of TcpListener
  2. The SessionListener should have a life time that is shorter than the life time of the depended connection
  3. The LinkListener should have a life time that is shorter than the life time of the depended session

error[E0107]: missing generics for struct `ConnectionHandle`, version 0.0.11

Hey,
I wanted to test the library with native-tls or rustls module enabled. Both cause an error while compiling:

error[E0107]: missing generics for struct `ConnectionHandle`
   --> /cargo/registry/src/github.com-1ecc6299db9ec823/fe2o3-amqp-0.0.11/src/connection/builder.rs:780:17
    |
780 |     ) -> Result<ConnectionHandle, OpenError>
    |                 ^^^^^^^^^^^^^^^^ expected 1 generic argument
    |
note: struct defined here, with 1 generic parameter: `R`
   --> /cargo/registry/src/github.com-1ecc6299db9ec823/fe2o3-amqp-0.0.11/src/connection/mod.rs:55:12
    |
55  | pub struct ConnectionHandle<R> {
    |            ^^^^^^^^^^^^^^^^ -
help: add missing generic argument
    |
780 |     ) -> Result<ConnectionHandle<R>, OpenError>
    |                 ~~~~~~~~~~~~~~~~~~~

Using Rust 1.60.0

AMQP version negotiation not working if initiated by broker

The last bullet point in chapter 2.2 Version Negotiation in the specification says the following:
Note that if the server only supports a single protocol version, it is consistent with the above rules for the server to send its protocol header prior to receiving anything from the client and to subsequently close the socket if the client’s protocol header does not match the server’s.
This is currently not working because in the SASL authorization can read too many bytes from the TcpStream. I'll link a workaround PR which fixed the issue for me but I think it could be handled more elegantly.

Receiver Settle Mode

Receiver Settle Mode

The specification says in mode First

The receiver will spontaneously settle all incoming transfers.

This description isn't clear on

  1. What does "spontaneously" mean here?
  2. What delivery state are the transfers settled with?

Other implementations

go-amqp

In ModeFirst, the transfers will be Accepted using acceptIfModeFirst immediately after the transfer is received. The discussion can be found at here

Originally posted by @minghuaw in #6 (comment)

implement serde_amqp

  • #2
  • (debatable) Change SerializeStructVariant and SerializeTupleVariant to unimplemented
  • add more test case for Value type

Decompose `EngineError`

There is currently a big umbrella error type EngineError that encompasses all the error types, but we clearly should expect the transport, connections, sessions, and links to have different errors. This issue will discuss how to decompose this big umbrella into smaller pieces so that it will become easier to handle properly

Complex type field with default in spec

Some fields in complex types have default values in spec. The current impl doesn't need Option<_> wrapper around the field type, which works fine with deserialization. However, this would make the protocol on the wire unnecessarily large on the wire.

Cancellation safety

Some tokio primitives are not cancellation safe and may lead to loss of data in tokio::select!. Notify is one of them. Whether cancellation safety should be taken care of should be investigated.

The following methods are cancellation safe:

tokio::sync::mpsc::Receiver::recv
tokio::sync::mpsc::UnboundedReceiver::recv
tokio::sync::broadcast::Receiver::recv
tokio::sync::watch::Receiver::changed
tokio::net::TcpListener::accept
tokio::net::UnixListener::accept
tokio::signal::unix::Signal::recv
tokio::io::AsyncReadExt::read on any AsyncRead
tokio::io::AsyncReadExt::read_buf on any AsyncRead
tokio::io::AsyncWriteExt::write on any AsyncWrite
tokio::io::AsyncWriteExt::write_buf on any AsyncWrite
tokio_stream::StreamExt::next on any Stream
futures::stream::StreamExt::next on any Stream

The following methods are not cancellation safe and can lead to loss of data:

tokio::io::AsyncReadExt::read_exact
tokio::io::AsyncReadExt::read_to_end
tokio::io::AsyncReadExt::read_to_string
tokio::io::AsyncWriteExt::write_all

The following methods are not cancellation safe because they use a queue for fairness and cancellation makes you lose your place in the queue:

tokio::sync::Mutex::lock
tokio::sync::RwLock::read
tokio::sync::RwLock::write
tokio::sync::Semaphore::acquire
tokio::sync::Notify::notified

Implement handler API

  • Find handlers available in Qpid-proton and amqpnetlite
  • Draft proposal
  • Find how TcpListener is implemented in tokio
  • Find the rust HTTP framework(s) implements endpoint handler
  • Implement handler API

Checking source filter

The receiving endpoint sets its desired filter, the sending endpoint
sets the filter actually in place (including any filters defaulted at the node). The receiving endpoint
MUST check that the filter in place meets its needs and take responsibility for detaching if it does
not.

Check discharging partial delivery of Post

It is an error for the controller to attempt to discharge a transaction against which a partial delivery has been posted.

How to handle this at the TxnManager level?

Design of Transaction Manager

This issue tracks design of transaction manager that handles incoming transactional request (including requests for establishing control links) at the session level. Any input/feedback is welcome.

Overall Design Goal

The specification requires the resource side settle the delivery if the delivery does not come settled.

Delivery Sent Unsettled By Controller; Resource Settles
The resource MUST determine the outcome of the delivery before committing the transaction, and this MUST be communicated to the controller before the acceptance of a successful discharge. The outcome communicated by the resource MUST be associated with the same transaction with which the transfer from controller to resource was associated.

This means the design of resource side transaction should allow user to decide the outcome of a transactional delivery. However, if the incoming transactions are handled the same way as incoming links, the users would have to deal with all the details of taking care of link frames. This also prevents having transactional resources at both the client and listener side of the connection.

The overall objective is to design a trait that can be implemented by external struct to handle incoming transactions while also providing a default implementation.

Field with `multiple="true"` should be encoded as an array

Multiple values are
represented by the use of an array where the type of the elements in the array is the type defined in the field
definition.

A field which is defined as both multiple and mandatory MUST contain at least one value (i.e. for such a field both
null and an array with no entries are invalid).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.