Hornetq server is not starting from command line - hornetq

I downloaded HornetQ for a JMS 2.0 application and extracted on Windows. Inside HornetQ there is the bin folder. In the bin folder There are .bat files that can start and stop server and it works. If I opened a command prompt in the bin folder and run the command hornetq start it does not start the server. I tried on Google but I couldn’t find the specific command. Can you please help me to know the start and stop command for HornetQ server? I used ActiveMQ server and it successfully started on command prompt. I just wanted the same for the HornetQ.

Running HornetQ from CMD
Here Start command is 'run' and for stopping the server we may use Ctrl+c command and then press 'Y'

The commands to start and stop HornetQ from the command prompt are run and stop which correspond to the run.bat and stop.bat batch files in the bin directory. The reason you can start ActiveMQ 5.x with activemq start is because ActiveMQ 5.x ships a batch file named activemq.bat in its bin directory. You can't really expect to use the same command format with different brokers because they are, in fact, different and support different methods for starting and stopping.
That said, I'm curious why you're using HornetQ at all at this point. The HornetQ code-based was donated to the Apache ActiveMQ project over 5 years ago now and exists as the ActiveMQ Artemis broker. Why don't you use that so you can have a broker under active development? Hundreds of bugs have been fixed and a ton of new features have been added in the previous 5 years.

Related

How to configure ActiveMQ Artemis as a broker in JBoss 4?

I configured a standalone ActiveMQ-5.16.1 to be used as a broker from a JBoss 4.2.3 server and my Camel-routes are able to get messages send from another component a ServerMix-Adaptor to this broker.
I replaced the standalone ActiveMQ-5.16.1 with an ActiveMQ Artemis-2.17.0 broker and besides few changes to the subscriptions the whole system is working.
I am aware that ActiveMQ 5.16.1 and ActiveMQ Artemis 2.17.0 are quite different, and I am trying to replace the activemq-rar-5.4.3.rar downloaded from here with the artemis-rar-2.17.0.rar downloaded from here. This .rar file is deployed under $JBOSS_HOME/server/default/deploy together with an *-ds.xml file.
In the *-ds.xml file 2 connection factories are declared, one for for queues and one for topics. This file references a file contained in the activemq-rar-5.4.3.rar META-INF/ra.xml and in this file are defined the connection-factories.
The problem is that even though the artemis-rar-2.17.0.rar contains the same META-INF/ra.xml file it's not obvious and not documented what to configure and how to configure it.
I couldn't find an example or a documentation about this.

cant start the kafka server in my directory kafka

i want to start my very first kafka, but when i tried to run this on my kafka_2.13-2.8.0 directory bin\windows\zookeeper-server-start.bat .. \ .. \config\zookeeper.properties
why it returns \Kafka\kafka_2.13-2.8.0\bin\windows\../ ../config/log4j.properties was unexpected at this time
idk i already followed this tip to install kafka https://www.youtube.com/watch?v=bYVyRh4C94E&t=303s
It's a known error in the Kafka log4j settings, especially if the install path contains spaces or non alphanumeric characters
If you really want to run Kafka on Windows, you should use WSL2 anyway, or Docker. Otherwise, assuming you did get the bat file working, you'd eventually run into other errors that crash the broker

Kafka not starting on windows

I have installed Zookeeper and Kakfa separately. Have started Zookeeper successfully. When I try to start Kafka on windows using the command,
C:\kafka_2.12-2.3.0\bin\windows>kafka-server-start.bat ../../config/server.properties
I keep getting,
\Novosoft\C2J\Bin\c2jruntime.zip was unexpected at this time.
Not sure what's causing this.
My environment variables had the CLASSPATH variable set to C:\Program Files (x86)\Novosoft\C2J\Bin\c2jruntime.zip.
Maybe Kafka was not liking it. Removed it and worked.
Kafka server started now

mapR Kafka cannot start second time round

To date I have either used an existing professional installation for Hadoop with components running, or, installed Kafka and used the also-supplied Zookeeper in a native VM.
I am trying to get the mapR Community Edition Sandbox to run now.
There is a KAFKA library on mapR, but here is no kafka shown when using jps. Seems odd? I managed to get KAFKA to start once.
There is a Zookeeper service on mapR but it uses port 5181, not 2181.
Kafka uses port 9092.
The log.dirs for kafka was set to /tmp/kafka-logs, I changed that to /opt/kafka-logs
The dataDir was also set to /tmp/zookeeper, I changed that to /opt/zookeeper
I also changed the Zookeeper port to 5181 as that is what mapR uses.
It ran once, and then I re-started and I still get this type of error:
java.io.FileNotFoundException: /tmp/kafka-logs/.lock (Permission denied)
I have done chmod 777 where required I think, but I changed the paths to /opt/... from /tmp. So why is it picking /tmp up again?
I have the impression that it keeps on point to /tmp regardless of the updates to the configurations.
I also see a warning - although I do not think this is an issue:
[2019-01-14 13:26:46,355] WARN No meta.properties file under dir /tmp/kafka-logs/meta.properties (kafka.server.BrokerMetadataCheckpoint)
May be because of the mapR Streams I cannot influence it so as to run natively?
OK, I could delete the question as I solved it, but for those on mapR I deduced:
You need to update the port 2181 to 5181 on server.properties immediately. In this case we integrate with an existing zookeeper instance.
Likewise, update the log.dirs for Kafka from /tmp/kafka-logs asap to /opt/kafka-logs.
Likewise, update the dataDir from /tmp/zookeeper asap to /opt/zookeeper.
Trying to fix latterly otherwise leads to all sorts of issues. I ended up just re-installing and doing it right from scratch.
mapR has a faster version called mapR Streams which implements Kafka. I was not wanting to use that for what I was wanting to do, but mapR Sandbox has a lot of up-to-date items straight out of the box -certainly compared to Cloudera.

How to read only new changes from a file using kafka producer

I am currently using windows machine and able to read whole file through command prompt using Kafka producer and consumer. I need to only get the recent changes in a file and need to use it in as input for Apache flink. I tried using this link but due to kafka client jar mismatch issue, i was not able to use it.
In my current approach when i call my producer each time it loads the whole file and we need to run it every time to see the changes occurred to file. I thought of using threads and some way of comparing difference in file using java code but is there any of doing only by Kafka.
I had similar problem recently (but in Linux) and solved it following way:
tail -f somefile.log | kafka-console-producer.sh ...
In your case you can try some Windows alternatives to Linux's tail: 13 Ways to Tail a Log File on Windows & Linux