[
https://issues.apache.org/jira/browse/ARTEMIS-2802?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17289127#comment-17289127
]
Christopher L. Shannon edited comment on ARTEMIS-2802 at 2/23/21, 3:20 PM:
---------------------------------------------------------------------------
I modified it a bit to spit out the full stack trace and the issue here is
actually a NPE that occurs because the metadata map is missing when using an
OpenWire connection.
That filter is valid but only for CORE connections as it is used to allow
hyphens in the key. The filter is used to prevent a loop with consumer creation
and demand as described in ARTEMIS-2531. The idea is we don't want federated
consumers to cause demand only real consumers. Federated consumers are always
CORE and the metadata map exists so the filter works fine.
We simply just need to make sure we check for null as OpenWire doesn't populate
that metadata map and the property won't exist ever for OpenWire connections
anyways.
{quote}eu-east-1-out:2021-02-23 10:14:16,205 ERROR
[org.apache.activemq.artemis.core.server] AMQ224006: Invalid filter:
hyphenated_props:federation-name IS NOT NULLeu-east-1-out:2021-02-23
10:14:16,205 ERROR [org.apache.activemq.artemis.core.server] AMQ224006: Invalid
filter: hyphenated_props:federation-name IS NOT
NULLus-central-1-err:*ava.lang.NullPointerExceptionus-central-1-err: at
org.apache.activemq.artemis.core.filter.impl.FilterImpl$FilterableMap.getProperty(FilterImpl.java:217)us-central-1-err:
at
org.apache.activemq.artemis.selector.filter.PropertyExpression.evaluate(PropertyExpression.java:40)us-central-1-err:
at
org.apache.activemq.artemis.selector.filter.ComparisonExpression$1.evaluate(ComparisonExpression.java:219)us-central-1-err:
at
org.apache.activemq.artemis.selector.filter.UnaryExpression$3.evaluate(UnaryExpression.java:135)us-central-1-err:
at
org.apache.activemq.artemis.selector.filter.UnaryExpression$BooleanUnaryExpression.matches(UnaryExpression.java:126)us-central-1-err:
at
org.apache.activemq.artemis.core.filter.impl.FilterImpl.match(FilterImpl.java:123)us-central-1-err:
at
org.apache.activemq.artemis.core.filter.impl.FilterImpl.match(FilterImpl.java:116)us-central-1-err:
at
org.apache.activemq.artemis.core.server.federation.queue.FederatedQueue.createRemoteConsumer(FederatedQueue.java:146)us-central-1-err:
at
org.apache.activemq.artemis.core.server.federation.queue.FederatedQueue.conditionalCreateRemoteConsumer(FederatedQueue.java:131)us-central-1-err:
at
org.apache.activemq.artemis.core.server.federation.queue.FederatedQueue.afterCreateConsumer(FederatedQueue.java:109)us-central-1-err:
at
org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.lambda$createConsumer$3(ServerSessionImpl.java:574)us-central-1-err:
at
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.callBrokerPlugins(ActiveMQServerImpl.java:2609)us-central-1-err:
at
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.callBrokerConsumerPlugins(ActiveMQServerImpl.java:2541)us-central-1-err:
at
org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.createConsumer(ServerSessionImpl.java:574)us-central-1-err:
at
org.apache.activemq.artemis.core.protocol.openwire.amq.AMQConsumer.init(AMQConsumer.java:160)
{quote}
I will submit a PR in a minute. I don't think a new test is really necessary as
existing tests should be enough, plus I'm not really even sure how to test it
since everything still works as is other than the error is spit out that will
now be gone by adding the NPE check.
was (Author: christopher.l.shannon):
I modified it a bit to spit out the full stack trace and the issue here is
actually a NPE that occurs because the metadata map is missing when using an
OpenWire connection.
That filter is valid but only for CORE connections as it is used to allow
hyphens in the key. The filter is used to prevent a loop with consumer creation
and demand as described in ARTEMIS-2531. The idea is we don't want federated
consumers to cause demand only real consumers. Federated consumers are always
CORE and the metadata map exists so the filter works fine.
We simply just need to make sure we check for null as OpenWire doesn't populate
that metadata map and the property won't exist ever for OpenWire connections
anyways.
{quote}eu-east-1-out:2021-02-23 10:14:16,205 ERROR
[org.apache.activemq.artemis.core.server] AMQ224006: Invalid filter:
hyphenated_props:federation-name IS NOT NULLeu-east-1-out:2021-02-23
10:14:16,205 ERROR [org.apache.activemq.artemis.core.server] AMQ224006: Invalid
filter: hyphenated_props:federation-name IS NOT
NULLus-central-1-err:*java.lang.NullPointerException*us-central-1-err: at
org.apache.activemq.artemis.core.filter.impl.FilterImpl$FilterableMap.getProperty(FilterImpl.java:217)us-central-1-err:
at
org.apache.activemq.artemis.selector.filter.PropertyExpression.evaluate(PropertyExpression.java:40)us-central-1-err:
at
org.apache.activemq.artemis.selector.filter.ComparisonExpression$1.evaluate(ComparisonExpression.java:219)us-central-1-err:
at
org.apache.activemq.artemis.selector.filter.UnaryExpression$3.evaluate(UnaryExpression.java:135)us-central-1-err:
at
org.apache.activemq.artemis.selector.filter.UnaryExpression$BooleanUnaryExpression.matches(UnaryExpression.java:126)us-central-1-err:
at
org.apache.activemq.artemis.core.filter.impl.FilterImpl.match(FilterImpl.java:123)us-central-1-err:
at
org.apache.activemq.artemis.core.filter.impl.FilterImpl.match(FilterImpl.java:116)us-central-1-err:
at
org.apache.activemq.artemis.core.server.federation.queue.FederatedQueue.createRemoteConsumer(FederatedQueue.java:146)us-central-1-err:
at
org.apache.activemq.artemis.core.server.federation.queue.FederatedQueue.conditionalCreateRemoteConsumer(FederatedQueue.java:131)us-central-1-err:
at
org.apache.activemq.artemis.core.server.federation.queue.FederatedQueue.afterCreateConsumer(FederatedQueue.java:109)us-central-1-err:
at
org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.lambda$createConsumer$3(ServerSessionImpl.java:574)us-central-1-err:
at
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.callBrokerPlugins(ActiveMQServerImpl.java:2609)us-central-1-err:
at
org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl.callBrokerConsumerPlugins(ActiveMQServerImpl.java:2541)us-central-1-err:
at
org.apache.activemq.artemis.core.server.impl.ServerSessionImpl.createConsumer(ServerSessionImpl.java:574)us-central-1-err:
at
org.apache.activemq.artemis.core.protocol.openwire.amq.AMQConsumer.init(AMQConsumer.java:160)
{quote}
I will submit a PR in a minute. I don't think a new test is really necessary as
existing tests should be enough, plus I'm not really even sure how to test it
since everything still works as is other than the error is spit out that will
now be gone by adding the NPE check.
> Federation not working when clients connect using OpenWire protocol
> -------------------------------------------------------------------
>
> Key: ARTEMIS-2802
> URL: https://issues.apache.org/jira/browse/ARTEMIS-2802
> Project: ActiveMQ Artemis
> Issue Type: Bug
> Components: OpenWire
> Affects Versions: 2.13.0
> Reporter: jerhat
> Priority: Minor
> Attachments: FederatedQueueTest.java, FederatedTestBase.java
>
>
> Reproducible by switching from:
>
> {code:java}
> import org.apache.activemq.artemis.jms.client.ActiveMQConnectionFactory;{code}
>
> to:
> {code:java}
> import org.apache.activemq.ActiveMQConnectionFactory;{code}
>
> and adding dependency:
> {code:java}
> <dependency>
> <groupId>org.apache.activemq</groupId>
> <artifactId>activemq-client</artifactId>
> <version>${activemq5-version}</version>
> </dependency>{code}
> to *federated-queue* example.
> Test will fail, below error is logged:
> {{ERROR [org.apache.activemq.artemis.core.server] AMQ224006: Invalid filter:
> hyphenated_props:federation-name IS NOT NULL}}
>
--
This message was sent by Atlassian Jira
(v8.3.4#803005)