Comments (6)
Just run the connector in distributed mode. Rather than using connect-standalone.sh, use two or more instances of connect-distributed.sh. Then use the Kafka Connect REST API to start the connector and it will be automatically made highly available among the distributed workers. No change to the connector required.
from kafka-connect-mq-source.
Thanks Andrew.
I tried to run the connector in distributed mode and it seems to be running fine. I see the java process listening on the default port of 8083 .However, I am getting HTTP 400 error while trying to post a curl request :
[root@ip-172-31-40-55 kafka_2.11-2.0.0]# curl -X POST -H "Content-Type: application/json" --data '{"name": "mq-source", "config": {"mq.record.builder":"com.ibm.eventstreams.connect.mqsource.MQSourceConnector", "tasks.max":"1", "mq.queue":"KAFKA", "mq.queue.manager":"XXXXXX" }}' http://localhost:8083/connectors
{"error_code":400,"message":"Connector config {mq.record.builder=com.ibm.eventstreams.connect.mqsource.MQSourceConnector, tasks.max=1, mq.queue=KAFKA, mq.queue.manager=XXXXX, name=mq-source} contains no connector type"}
Am i missing anything on my Curl request ?
Regards
from kafka-connect-mq-source.
You have typed mq.record.builder
but it should be connector.class
.
from kafka-connect-mq-source.
Hi Andrew,
I replaced "mq.record.builder" with "connector.class" but got the below error (looks like mq.record.builder is a mandatory element) :
curl -X POST -H "Content-Type: application/json" --data '{"name": "mq-source", "config": {"connector.class":"com.ibm.eventstreams.connect.mqsource.MQSourceConnector", "tasks.max":"1", "mq.queue":"KAFKA", "mq.queue.manager":"FMQSOCQM02" }}' http://localhost:8083/connectors
{"error_code":400,"message":"Connector configuration is invalid and contains the following 1 error(s):\nMissing required configuration "mq.record.builder" which has no default value.\nYou can also find the above list of errors at the endpoint /{connectorType}/config/validate
"}
I added both "connector.class" and "mq.record.builder" with the class name and got the below response without any error code :
curl -X POST -H "Content-Type: application/json" --data '{"name": "mq-source", "config": {"connector.class":"com.ibm.eventstreams.connect.mqsource.MQSourceConnector", "tasks.max":"1", "mq.queue":"KAFKA", "mq.queue.manager":"FMQSOCQM02", "mq.record.builder":"com.ibm.eventstreams.connect.mqsource.MQSourceConnector" }}' http://localhost:8083/connectors
{"name":"mq-source","config":{"connector.class":"com.ibm.eventstreams.connect.mqsource.MQSourceConnector","tasks.max":"1","mq.queue":"KAFKA","mq.queue.manager":"FMQSOCQM02","mq.record.builder":"com.ibm.eventstreams.connect.mqsource.MQSourceConnector","name":"mq-source"},"tasks":[],"type":null}
But immediately the connector in distributed mode started getting the JMS exception (and now for some strange reason every time I am starting the connector in distributed mode I keep
getting the same error) :
ERROR WorkerSourceTask{id=mq-source-0} Task threw an uncaught and unrecoverable exception (org.apache.kafka.connect.runtime.WorkerTask:177)
org.apache.kafka.connect.errors.ConnectException: com.ibm.msg.client.jms.DetailedJMSException: JMSCC0005: The specified value '' is not allowed for 'XMSC_WMQ_CHANNEL'.
The given value is not allowed for the property specified.
Change the value to a value that is supported for the property.
at com.ibm.eventstreams.connect.mqsource.JMSReader.configure(JMSReader.java:164)
at com.ibm.eventstreams.connect.mqsource.MQSourceTask.start(MQSourceTask.java:81)
at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:198)
at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:175)
at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:219)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
Caused by: com.ibm.msg.client.jms.DetailedJMSException: JMSCC0005: The specified value '' is not allowed for 'XMSC_WMQ_CHANNEL'.
The error : com.ibm.msg.client.jms.DetailedJMSException: JMSCC0005: The specified value '' is not allowed for 'XMSC_WMQ_CHANNEL'. is a bit confusing because the mq-source.properties file is correctly set with the channel name.
Regards
from kafka-connect-mq-source.
Hi Andrew,
I was able to get rid of "JMSCC0005: The specified value '' is not allowed for 'XMSC_WMQ_CHANNEL'." error. It seems we have to pass the mq.channel.name config as well in the REST command. Below is what the updated command looks like :
curl -X POST -H "Content-Type: application/json" --data '{"name": "mq-source1", "config": {"connector.class":"com.ibm.eventstreams.connect.mqsource.MQSourceConnector", "tasks.max":"1", "mq.queue":"KAFKA", "mq.queue.manager":"KAFKA_QM", "mq.channel.name":"KAFKA_DIS_SVRCONN", "mq.record.builder":"com.ibm.eventstreams.connect.mqsource.MQSourceConnector" }}' http://localhost:8085/connectors
However, I still got below error :
ERROR WorkerSourceTask{id=mq-source1-0} Task threw an uncaught and unrecoverable exception (org.apache.kafka.connect.runtime.WorkerTask:177)
java.lang.ClassCastException: class com.ibm.eventstreams.connect.mqsource.MQSourceConnector
Not sure on how to proceed since the error seems very generic one.
Complete error trace :
[2019-07-25 10:35:46,955] ERROR WorkerSourceTask{id=mq-source1-0} Task threw an uncaught and unrecoverable exception (org.apache.kafka.connect.runtime.WorkerTask:177)
java.lang.ClassCastException: class com.ibm.eventstreams.connect.mqsource.MQSourceConnector
at java.lang.Class.asSubclass(Class.java:3404)
at com.ibm.eventstreams.connect.mqsource.JMSReader.configure(JMSReader.java:168)
at com.ibm.eventstreams.connect.mqsource.MQSourceTask.start(MQSourceTask.java:81)
at org.apache.kafka.connect.runtime.WorkerSourceTask.execute(WorkerSourceTask.java:198)
at org.apache.kafka.connect.runtime.WorkerTask.doRun(WorkerTask.java:175)
at org.apache.kafka.connect.runtime.WorkerTask.run(WorkerTask.java:219)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
at java.lang.Thread.run(Thread.java:748)
[2019-07-25 10:35:46,956] ERROR WorkerSourceTask{id=mq-source1-0} Task is being killed and will not recover until manually restarted (org.apache.kafka.connect.runtime.WorkerTask:178)
connect-distributed.properties file :
group.id=connect-cluster
key.converter.schemas.enable=true
value.converter.schemas.enable=true
offset.storage.topic=connect-offsets
offset.storage.replication.factor=1
config.storage.topic=connect-configs
config.storage.replication.factor=1
status.storage.topic=connect-status
status.storage.replication.factor=1
offset.flush.interval.ms=10000
rest.host.name=localhost
rest.port=8085
rest.advertised.host.name=localhost
rest.advertised.port=8085
Regards
from kafka-connect-mq-source.
Hi, please take the latest version of the connector, run it again and open a new issue if you see the problem. That will help me understand what's going on. Thanks, Andrew
from kafka-connect-mq-source.
Related Issues (20)
- Avro schema problems with builders HOT 1
- Set MQGetMessageOptions on createConsumer HOT 7
- Update to strimzi kafka image 2.6.0 to 3.4.0 HOT 3
- 🐛 [BUG] - Failed to find any class that implements Connector and which name matches com.ibm.eventstreams.connect.mqsource.MQSourceConnector HOT 2
- SMT supportiveness HOT 11
- 🐛 [BUG] - When reading a message that contains RFH header no exception is being thrown HOT 2
- 🐛 [BUG] - valueSchema is always null HOT 3
- Connectors V2 is it a new release HOT 6
- 💡 [Feature] - Ability to set CCSID for MQ connector to non-default value HOT 6
- Reg New Lisenced Version HOT 1
- 💡 [Feature] - pull from IBM MQ Topics HOT 2
- 🐛 [BUG] - Start MQ Source Connector on Kubernetes HOT 2
- While using 6 tasks and connect worker gets stopped and started due to a wrong format message , Duplicate messages are received in Kafka HOT 2
- 🐛 [BUG] - NullPointerException while reading JMSCorrelationID
- Kafka Connect source connector's tasks going up and down HOT 1
- IBM MQ Admin reports too many connections when IBM MQ source connector is used HOT 11
- No connectivity established with MQ in distributed mode HOT 1
- Guarantees when moving messages from MQ to Kafka HOT 2
- Key and partitioning support for arbitrary JMS Headers HOT 1
- kafka producer task shutdown , but MQ listener is still running HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kafka-connect-mq-source.