Seriously confused: has ActiveMQ dropped support for connection pooling? - activemq

I'm new to ActiveMQ (we use Apollo for the broker). Everything I read says to use org.apache.activemq.pool.PooledConnectionFactory for connection pool, except that class does not exist in activemq-all-5.5.0.jar. According to jarfinder.com that class only exists in older versions of ActiveMQ.
Do I have to include Spring or something? How does one pool connections?
Thanks

In a standard ActiveMQ distribution you have lib/optional/activemq-pool-5.8.0.jar which contains this class.
Not sure for apollo, but I guess you use the ActiveMQ JMS library for that anyway?

For maven users, this helps:
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-client</artifactId>
<version>${activemq.version}</version>
</dependency>
<dependency>
<groupId>org.apache.activemq</groupId>
<artifactId>activemq-pool</artifactId>
<version>${activemq.version}</version>
</dependency>

Related

weblogic.jdbc.common.internal.RmiDataSource_12212_WLStub cannot be cast to javax.sql.DataSource

My app is trying to access DataSource through JNDI on Weblogic(12) Server. The following exception is thrown
weblogic.jdbc.common.internal.RmiDataSource_12212_WLStub cannot be cast to javax.sql.DataSource
Where is this class weblogic.jdbc.common.internal.RmiDataSource_12212_WLStub coming into picture.
From My Oracle Support (Doc ID 2005891.1) Version 12.1.1.0 and later
The remote datasource lookup over RMI is not supported with any thin client jar file.
The Wlthint3client.jar library does not support remote datasource lookup over RMI as the required stub classes are not bundled with this jar file, and hence the error.
JDBC over RMI is also deprecated in general and it can easily be a significant security vulnerability.
It normally works with the full WLS client jar library. But it is also not recommended - as this feature is currently deprecated and it might be completely removed in the future release.
Alternatives are to use the JDBC driver if you want to create connections to the database from a remote client, or deploy a local EJB which acquires the connection by doing a local lookup of the datasource.
The WebLogic full client, wlfullclient.jar, is deprecated as of WebLogic Server 12.1.3 and may be removed in a future release. Oracle recommends using the WebLogic Thin T3 client or other appropriate client depending on your environment. For more information on WebLogic client types.
Reference Link
https://docs.oracle.com/middleware/12213/wls/SACLT/jarbuilder.htm#SACLT240

mule udp connection with multicasting

I'm trying to set up a UDP connector in mule and can not figure out how to set to multicast using the configurations.
In the mule documentation there is a separate multicast connector but that is not available in Anypoint Studio.
If your project is Mavenized, you could include the following dependency in the pom.xml to utilize multicasting.
<dependency>
<groupId>org.mule.transports</groupId>
<artifactId>mule-transport-multicast</artifactId>
<version>${mule.version}</version>
</dependency>
Within your configuration, you might use the following for your multicast connector.
<multicast:connector
name="multiCastConnector"
receiveBufferSize="1024"
sendBufferSize="1024"
timeout="0"
keepSendSocketOpen="false"
broadcast="false"
timeToLive="127"
loopback="true"/>
In your flow, you can reference this connector in your UDP endpoint.
connector-ref="multiCastConnector"
You will also need to ensure the following is included in your namespace in the configuration,
xmlns:multicast="http://www.mulesoft.org/schema/mule/multicast"
and in the schemaLocation.
http://www.mulesoft.org/schema/mule/multicast http://www.mulesoft.org/schema/mule/multicast/current/mule-multicast.xsd

ActiveMQ persistance Adapter configuration issue

i am new with ActiveMQ version (5.3) I have de following configuration, on the activemq.xml file:
<persistenceAdapter>
<amqPersistenceAdapter syncOnWrite="false" directory="${activemq.base}/data" maxFileLength="20 mb" />
</persistenceAdapter>
And now, i am trying to upgrade to version (5.13) and in this configuration it does not have the element amqPersistenceAdapter please help me to find and element that I can use in version 5.13
amqPersistenceAdapter was replaced with kahadb over the various ActiveMQ releases since 5.3. So take a look at kahadb in the ActiveMQ documentation how to use and configure it. In fact its configured to use kahadb out of the box, so take a look at the vanilla configuration from the ActiveMQ 5.13 release.
http://activemq.apache.org/kahadb.html

Implementing kafka consumer in spark-1.0

I need to implement kafka consumer in spark streaming for spark 1.0 . I have written a kafka producer. Can anyone please help me on how to write a spark receiver for pulling the messages from kafka? Also, May I please know how to run kafka spark streaming project in Intellij IDEA?
Spark streaming comes with its own consumer.
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-streaming-kafka_2.10</artifactId>
<version>1.0.2</version>
</dependency>
And in the official repository exists some examples for streaming and a wordcount for kafka.
In intellij just import spark-streaming and spark-streaming-kafka modules and write a simple main like the example.
https://github.com/dibbhatt/kafka-spark-consumer
..
This utility will help to pull messages from Kafka Cluster using Spark
Streaming. The Kafka Consumer is Low Level Kafka Consumer (
SimpleConsumer) and have better handling of the Kafka Offsets and
handle failures
..
And according to this blog post,
provides better replaying control in case of downstream failures (e.g. Spark machines died).
use KafkaUtils.createStream();
Here's the API: https://spark.apache.org/docs/1.0.2/api/java/index.html?org/apache/spark/streaming/kafka/KafkaUtils.html

Use ActiveMQ JAR with an older broker

In our production environment we use ActiveMQ 5.4.3
We encouter a problem since we added the option schedulerSupport="true" in the broker. The problem encountered is : javax.jms.JMSException: PageFile is not loaded
I recently discovered that this problem is fixed in the version 5.8
Would it be a problem to use the jar activemq-all-5.8.0.jar with that broker or do I have to upgrade the broker from 5.4.3 to 5.8 too ?
Thanks
It's recommend that client and Broker use the same versions. In theory you can mix versions as the underlying Openwire protocol is backwards compatible however it's not something we test heavily. The usual case if that people can upgrade their Broker and need to leave client's behind and that is known to work better. The problem with mixing versions is that there may be bug fixes in one that are necessary for the other to function correctly so you might still see bad behaviour even though you think it should improve things.