Coder Social home page Coder Social logo

mqkafka's Introduction

docker-machine start docker run --env LICENSE=accept --env MQ_QMGR_NAME=QM1 --publish 1414:1414 --publish 9443:9443 --detach ibmcom/mq docker-machine ip

//kafka cd E:\kafka\kafka_2.12-2.1.0\bin\windows zookeeper-server-start.bat ....\config\zookeeper.properties kafka-server-start.bat ....\config\server.properties kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic flink_output kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic flink_input kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic rabbitmqkafka #kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic mqkafka kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic byte

zookeeper-server-start ../../config/zookeeper.properties kafka-server-start ../../config/server.properties kafka-topics --zookeeper localhost:2181 --list

kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic rabbitmqkafka --from-beginning --max-messages 100 kafka-avro-console-consumer --bootstrap-server localhost:9092 --topic rabbitmqkafka --from-beginning --max-messages 100

xml->avro

  1. https://github.com/elodina/xml-avro SimpleConverter good, use this
  2. https://www.confluent.io/blog/kafka-connect-single-message-transformation-tutorial-with-examples/ NA
  3. https://github.com/mit-ll/xml-avro-converter complicated, hard to implement

############################################# cd /cygdrive/e/confluent-6.0.0 ./bin/schema-registry-start ./etc/schema-registry/schema-registry.properties

#############################################

http://localhost:8081/subjects

{ "namespace": "com.mq.demo", "protocol": "xml", "types": [{"name": "Attribute", "type": "record", "fields": [{"name": "name", "type": "string"}, {"name": "value", "type": "string" }]}, {"name": "Element", "type": "record", "fields": [{"name": "name", "type": "string"}, {"name": "attributes", "type": {"type": "array", "items": "Attribute"}}, {"name": "children", "type": {"type": "array", "items": ["Element", "string"]} } ] } ] }

curl -X POST -H "Content-Type: application/vnd.schemaregistry.v1+json" --data '{"schema": "{ "namespace": "com.mq.demo", "protocol": "xml", "types": [{"name": "Attribute", "type": "record", "fields": [{"name": "name", "type": "string"}, {"name": "value", "type": "string" }]}, {"name": "Element", "type": "record", "fields": [{"name": "name", "type": "string"}, {"name": "attributes", "type": {"type": "array", "items": "Attribute"}}, {"name": "children", "type": {"type": "array", "items": ["Element", "string"]} } ] } ] }"}' http://localhost:8081/subjects/rabbitmqkafka-value-value/versions

##############################################

java -jar "E:\m2repo\repository\org\apache\avro\avro-tools\1.10.0\avro-tools-1.10.0.jar" compile schema xml.avsc .

##################################################

xml -> avro file ByteArraySerializer

mqkafka's People

Contributors

incredibleliu avatar

Watchers

James Cloos avatar  avatar

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.