-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Armand Caesar
committed
Feb 9, 2021
1 parent
48b79c9
commit 6e00990
Showing
18 changed files
with
52 additions
and
1,171 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,36 @@ | ||
package messagebus | ||
|
||
import ( | ||
"time" | ||
|
||
"github.com/confluentinc/confluent-kafka-go/kafka" | ||
"github.com/kata-ai/messagebus-golang-kafka/messagebus/record" | ||
) | ||
|
||
type IMessageBus interface { | ||
Send(service string, message *record.ProducerRecord) (kafka.Offset, error) | ||
Send(service string, message *ProducerRecord) (kafka.Offset, error) | ||
Subscribe(topic string) error | ||
Unsubscribe(topic string) error | ||
Request(service string, message *record.ProducerRecord) (*record.ConsumerRecord, error) | ||
Request(service string, message *ProducerRecord) (*ConsumerRecord, error) | ||
Disconnect() error | ||
} | ||
|
||
type Handler interface { | ||
HandleMessage(context MessageContext) | ||
} | ||
|
||
type ISerializer interface { | ||
Serialize(topic string, record *ProducerRecord) (*SerializedProducerRecord, error) | ||
Deserialize(message *kafka.Message) (*ConsumerRecord, error) | ||
} | ||
|
||
type ISchemaRegistryClient interface { | ||
getSchema(schemaID int) (*Schema, error) | ||
getLatestSchema(subject string, isKey bool) (*Schema, error) | ||
getSchemaVersions(subject string, isKey bool) ([]int, error) | ||
getSchemaByVersion(subject string, version int, isKey bool) (*Schema, error) | ||
createSchema(subject string, schema string, schemaType SchemaType, isKey bool) (*Schema, error) | ||
setCredentials(username string, password string) | ||
setTimeout(timeout time.Duration) | ||
isCachingEnabled(value bool) | ||
isCodecCreationEnabled(value bool) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.