adrianco / spigo

Simulate Protocol Interactions in Go
Apache License 2.0
1.12k stars 111 forks source link

Extend message to include separate header, URI and body strings, or parse json body #14

Open adrianco opened 9 years ago

adrianco commented 9 years ago

Each message needs a header that can include the kind of things that live in HTTP headers, i.e. mime types for the content, transaction id's for zipkin like tracing.

Each get, put or delete message could have a URI in the format Imposition: Put header: transactionid:1 uri: gotocol://servicename/route/keyspace/key body: value

The servicename would be looked up and would process the level2/level3/thing

Response messages would use the transaction id from the header to lookup the return service path Imposition: GetResponse header: transactionid:2 uri: gotocol://keyspace/key body: value

These could be implemented as separate strings in gotocol or as a combined json payload in a single string. Need to benchmark the difference.

For branching transactions, needs a parent txid and a child txid