What is the Jboss4 xml configuration equivalent of ActivationConfigProperty? - jboss

I have an MDB deployed nicely within JBoss-4.0.4 with this annotation. It works very well.
#MessageDriven(
activationConfig = {
#ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Queue"),
#ActivationConfigProperty(propertyName = "destination",
propertyValue = "queue/mycompany/thing/thingy"),
#ActivationConfigProperty(propertyName = "MaxPoolSize",
propertyValue = "4")
}
)
Now I need to externalise that configuration so I can change MaxPoolSize without having to recompile and redeploy the code. According to the docs it looks this should appear in the standardjboss.xml as a new <proxy-factory-config> but what value should I use for <JMSProviderAdapterJNDI>, <ServerSessionPoolFactoryJNDI> etc? Is this change (adding a new <proxy-factory-config> element) the only thing I need?
<proxy-factory-config>
<JMSProviderAdapterJNDI>WHATGOESHERE?</JMSProviderAdapterJNDI>
<ServerSessionPoolFactoryJNDI>WHATGOESHERE?</ServerSessionPoolFactoryJNDI>
<MaximumSize>3</MaximumSize>
<MaxMessages>1</MaxMessages>
<MDBConfig>
<ReconnectIntervalSec>10</ReconnectIntervalSec>
<DLQConfig>
<DestinationQueue>queue/mycompany/thing/thingy</DestinationQueue>
<MaxTimesRedelivered>10</MaxTimesRedelivered>
<TimeToLive>0</TimeToLive>
</DLQConfig>
</MDBConfig>
</proxy-factory-config>

Related

JBoss EAP 6.4.2 is not listening from multiple remote servers

I am having a problem setting MDB to listen to multiple remote servers on JBoss EAP 6.4.2 with Windows OS. When I set 2 servers to listen on connectionParameters it's getting messages from only one of them.
If I set only one server to listen it works well. But can't listen to 2 or more server at the same time. following is my MDB
#MessageDriven(mappedName = "TestTopicRemote", activationConfig = {
#ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
#ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Topic"),
#ActivationConfigProperty(propertyName = "destination", propertyValue = "cacheTopic"),
#ActivationConfigProperty(propertyName = "connectorClassName", propertyValue = "org.hornetq.core.remoting.impl.netty.NettyConnectorFactory,org.hornetq.core.remoting.impl.netty.NettyConnectorFactory"),
#ActivationConfigProperty(propertyName = "connectionParameters", propertyValue = "host=172.16.116.32;port=5445,host=172.16.116.107;port=5445"),
#ActivationConfigProperty(propertyName = "user", propertyValue = "guest"),
#ActivationConfigProperty(propertyName = "password", propertyValue = "password1")}
)
I believe you have misunderstood the functionality provided by the connectionParameters activation configuration property and MDB functionality in general. A JMS MDB in JBoss EAP cannot directly receive messages from multiple brokers.
The connectionParameters activation configuration property supports multiple entries, but only one will actually be used. Typically the entries are for all the servers in a cluster or the master & slave of an HA pair.
Are the Artemis brokers running on 172.16.116.32 and 172.16.116.107 part of a cluster? If so, consumers connecting to any node in the cluster should be able to receive messages produced to any other node in the cluster assuming the brokers in the cluster have the appropriate configuration.

CORS configuration play scala

How can I configure CORS to accept headers and everything in Play when I connect to it with angular7.
I saw documentation but it doesn't t help me that much.
Is it only configured in app.conf?
play.filters.cors {
pathPrefixes = ["/"]
allowedOrigins = null
allowedHttpMethods = null
allowedHttpHeaders = null
exposedHeaders = ["Access-Control-Allow-Origin"]
preflightMaxAge = 3 days
}

Quartz : There is no DataSource named 'myDS'

When i use datasource name as "quartzDS" everything is working fine, but when i change datasource name to any other name any other like "myDS". i get error.
Caused by: java.sql.SQLException: There is no DataSource named 'myDS'
My quartz.properties file.
org.quartz.scheduler.instanceName = QuartzClusterScheduler
org.quartz.scheduler.instanceId = AUTO
org.quartz.threadPool.class = org.quartz.simpl.SimpleThreadPool
org.quartz.threadPool.threadCount = 100
org.quartz.threadPool.threadPriority = 8
org.quartz.jobStore.class = org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass = org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.useProperties = false
org.quartz.jobStore.dataSource = myDS
org.quartz.jobStore.misfireThreshold = 60000
org.quartz.jobStore.tablePrefix = QRTZ_
org.quartz.jobStore.isClustered = true
org.quartz.jobStore.clusterCheckinInterval = 5000
org.quartz.dataSource.quartzDS.jndiURL = java:jboss/myDS
Resolved, Changed from
org.quartz.dataSource.quartzDS.jndiURL = java:jboss/myDS
to
org.quartz.dataSource.myDS.jndiURL = java:jboss/myDS

ActiveMQ - client already connected with same clientId error

We have a setup of JBoss EAP 7.0.0.GA connecting to ActivMQ apache-activemq-5.14.3. We are trying to setup a durable subscriber with the following configuration:
#MessageDriven(
name = "TestListener",
activationConfig = {
#ActivationConfigProperty(propertyName = "destinationType",
propertyValue = "javax.jms.Topic"),
#ActivationConfigProperty(propertyName = "subscriptionDurability",
propertyValue = "Durable"),
#ActivationConfigProperty(propertyName = "subscriptionName",
propertyValue = "subscriptionNameTest"),
#ActivationConfigProperty(propertyName = "clientId",
propertyValue = "2"),
#ActivationConfigProperty(propertyName = "destination",
propertyValue = "jms/testTopic")
}
)
#PermitAll
#ResourceAdapter(value="activemq-rar.rar")
However, we are getting the following exception in the JBoss server console
ERROR [org.apache.activemq.ra.ActiveMQEndpointWorker] (default-threads - 4) Failed to connect to broker [tcp://127.0.0.1:61616?jms.rmIdFromConnectionId=true]: Broker: TestBroker - Client: 2 already connected from tcp://127.0.0.1:64246: javax.jms.InvalidClientIDException: Broker: TestBroker - Client: 2 already connected from tcp://127.0.0.1:64246
At the same time if we see the following logs at the activmq :
WARN | Failed to add Connection ID: 40600-51:1 due to javax.jms.InvalidClientIDException: Broker: TestBroker - Client: 2 already connected from tcp://127.0.0.1:64246 | org.apache.activemq.broker.TransportConnection | ActiveMQ Transport: tcp:///127.0.0.1:50170#61616
The ActiveMQManagedConnectionFactory settings are as follows (tried setting the max-pool-size to 1, but to no effect):
/subsystem=resource-adapters/resource-adapter=activemq-rar.rar/connection-definitions=ConnectionFactory:add(class-name="org.apache.activemq.ra.ActiveMQManagedConnectionFactory", jndi-name="java:/MyConnectionFactory", enabled=true, min-pool-size=1, max-pool-size=20, pool-prefill=false, same-rm-override=false, recovery-username=ejb_user, recovery-password=xxxxx)
Request help from AMQ experts please.
only way I have been able to get AMQ and jboss to behave without a thousand threads doing stupid things is to setup the RAR with an embedded broker and then network connect the embedded broker with your external broker.
Perhaps, changing your property/configuration would solve your issue.
Try for example to change your client id by using the following configuration:
#ActivationConfigProperty(propertyName="clientId", propertyValue = "2-${jboss.node.name}")
This will ensure that your clientId is unique

How to map a websphere mq 7 queue to a EJB 3 destinationName

I need to map WebSphere MQ7 queue (Say queA in Queue Manager QMA) to a EJB3 MDB.
I created the MQ Queue Manager and Queue using
crtmqm QMA and start it using strmqm MQA
Then i wrote a file file name QMA.conf and included
DEFINE QLOCAL ('queA')
line it and run the command
runmqsc QMA < QMA.conf
then I run
strmqcsv MQA &
runmqlsr -m QMA -t TCP &
All these steps done as mqm logged user.
Then I follow
http://community.jboss.org/wiki/JBossEAP5IntegrationwithWebSphereMQ
link and configure RAR to the jboss 5.1. When I run the test connection that also succeeded.
There I include
* channel - SYSTEM.DEF.SVRCONN
* hostName - localhost
* port - 1414
* queueManager - ExampleQM
* transportType - CLIENT
and In my MDB I include
#MessageDriven( name="WMQMDBTest",
activationConfig =
{
#ActivationConfigProperty(propertyName="messagingType",propertyValue="javax.jms.MessageListener"),
#ActivationConfigProperty(propertyName = "destinationType",propertyValue = "javax.jms.Queue"),
#ActivationConfigProperty(propertyName = "destination", propertyValue = "queA"),
#ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "true"),
#ActivationConfigProperty(propertyName = "channel", propertyValue = "SYSTEM.DEF.SVRCONN"),
#ActivationConfigProperty(propertyName = "hostName", propertyValue = "localhost"),
#ActivationConfigProperty(propertyName = "queueManager", propertyValue = "QMA"),
#ActivationConfigProperty(propertyName = "port", propertyValue = "1414"),
#ActivationConfigProperty(propertyName = "transportType", propertyValue = "CLIENT"),
#ActivationConfigProperty(propertyName = "username", propertyValue = "mqm"),
#ActivationConfigProperty(propertyName = "password", propertyValue = "password")
})
#TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
#ResourceAdapter(value = "wmq.jmsra.rar")
When I try to deploy the bean it says
DEPLOYMENTS IN ERROR:
Deployment "jboss.j2ee:ear=integration-1.0-SNAPSHOT.ear,jar=business-logic-1.0-SNAPSHOT.jar,
name=WMQMDBTest,service=EJB3" is in error due to the following reason(s):
javax.naming.NameNotFoundException: queA not bound
You've written
#ActivationConfigProperty(propertyName = "destination", propertyValue = "queA"),
#ActivationConfigProperty(propertyName = "useJNDI", propertyValue = "true"),
with the useJNDI property implying that 'queA' is the name under which the JMS Queue is bound into the JNDI namespace - this does not directly correspond to the queue you have defined here
DEFINE QLOCAL ('queA')
If you want it to refer to a physical WMQ queue on your queue manager then you need the useJNDI property set to false, in which case destination specifies the name of a queue on the queue manager, not a JNDI name. On the other hand, if you do want to use JNDI lookup of Destinations then you need to ensure that the destination name specified matches the Queue definition in the -ds.xml file, e.g.
#ActivationConfigProperty(propertyName = "destination", propertyValue = "jms/request")
would correspond to
<mbean code="org.jboss.resource.deployment.AdminObject" name="jca.wmq:name=request_queue">
<attribute name="JNDIName">jms/request</attribute>
<depends optional-attribute-name="RARName">jboss.jca:service=RARDeployment,name='wmq.jmsra.rar'</depends>
<attribute name="Type">javax.jms.Queue</attribute>
<attribute name="Properties">
baseQueueManagerName=QMA
baseQueueName=queA
</attribute>
</mbean>
note the JNDIName attribute of the mbean corresponds to the destination name