简体   繁体   中英

ParseError using JGroups for HornetQ in WildFly 9

Currently I am using WildFly 9. We are trying to configure TCP-based load sharing with HornetQ. We have use JGroups for dynamic discovery, and we have added following setting in our standalone configuration file.

<broadcast-groups>
    <broadcast-group name="my-broadcast-group">
        <jgroups-file>jgroups-stacks.xml</jgroups-file>
        <jgroups-channel>hornetq_broadcast_channel</jgroups-channel>
        <broadcast-period>2000</broadcast-period>
        <connector-ref connector-name="netty-connector"/>
    </broadcast-group>
</broadcast-groups>
<discovery-groups>
    <discovery-group name="dg-group1">
        <jgroups-file>jgroups-stacks.xml</jgroups-file>
        <jgroups-channel>hornetq_broadcast_channel</jgroups-channel>
        <refresh-timeout>10000</refresh-timeout>
    </discovery-group>
</discovery-groups>
<cluster-connections>
    <cluster-connection name="tcp-based-cluster-node1-to-node2">
        <address>jms</address>
        <connector-ref>netty</connector-ref>
        <retry-interval>500</retry-interval>
        <use-duplicate-detection>true</use-duplicate-detection>
        <forward-when-no-consumers>true</forward-when-no-consumers>
        <max-hops>1</max-hops>
        <discovery-group-ref discovery-group-name="dg-group1"/>
    </cluster-connection>
</cluster-connections>

I have do configuration from this documentation , but still I faced issue here with jgroup-file . It is give following error:

Caused by: javax.xml.stream.XMLStreamException: ParseError at [row,col]:[393,21]
Message: WFLYCTL0198: Unexpected element '{urn:jboss:domain:messaging:3.0}jgroups-file' encountered
    at org.jboss.as.controller.parsing.ParseUtils.unexpectedElement(ParseUtils.java:89)
    at org.jboss.as.messaging.MessagingSubsystemParser.handleUnknownBroadcastGroupAttribute(MessagingSubsystemParser.java:739)
    at org.jboss.as.messaging.Messaging13SubsystemParser.handleUnknownBroadcastGroupAttribute(Messaging13SubsystemParser.java:182)

Here, issue is file was not found at server run time. As per document we have to set in resource folder but in HornetQ WildFly server have no resource folder so where we can set file and share load with multiple queue?

So my question is first we are on right way or do we need to do any other configuration for the same?

The documentation you're looking at is for HornetQ, not for WildFly. WildFly has a unique XML format which is 100% independent of HornetQ's format, although they are very similar in many places in early versions of WildFly. However, WildFly doesn't support the jgroups-file configuration element you're attempting to use. Only standalone HornetQ supports that.

You should look at the standalone-full-ha.xml file that ships with WildFly 9. It has an example of JGroups configuration, eg:

        ...
        <subsystem xmlns="urn:jboss:domain:jgroups:3.0">
            <channels default="ee">
                <channel name="ee"/>
            </channels>
            <stacks default="udp">
                <stack name="udp">
                    <transport type="UDP" socket-binding="jgroups-udp"/>
                    <protocol type="PING"/>
                    <protocol type="MERGE3"/>
                    <protocol type="FD_SOCK" socket-binding="jgroups-udp-fd"/>
                    <protocol type="FD_ALL"/>
                    <protocol type="VERIFY_SUSPECT"/>
                    <protocol type="pbcast.NAKACK2"/>
                    <protocol type="UNICAST3"/>
                    <protocol type="pbcast.STABLE"/>
                    <protocol type="pbcast.GMS"/>
                    <protocol type="UFC"/>
                    <protocol type="MFC"/>
                    <protocol type="FRAG2"/>
                    <protocol type="RSVP"/>
                </stack>
                <stack name="tcp">
                    <transport type="TCP" socket-binding="jgroups-tcp"/>
                    <protocol type="MPING" socket-binding="jgroups-mping"/>
                    <protocol type="MERGE3"/>
                    <protocol type="FD_SOCK" socket-binding="jgroups-tcp-fd"/>
                    <protocol type="FD"/>
                    <protocol type="VERIFY_SUSPECT"/>
                    <protocol type="pbcast.NAKACK2"/>
                    <protocol type="UNICAST3"/>
                    <protocol type="pbcast.STABLE"/>
                    <protocol type="pbcast.GMS"/>
                    <protocol type="MFC"/>
                    <protocol type="FRAG2"/>
                    <protocol type="RSVP"/>
                </stack>
            </stacks>
        </subsystem>
        ...
        <subsystem xmlns="urn:jboss:domain:messaging:3.0">
            <hornetq-server>
                ...
                <broadcast-groups>
                    <broadcast-group name="bg-group1">
                        <jgroups-stack>udp</jgroups-stack>
                        <jgroups-channel>hq-cluster</jgroups-channel>
                        <connector-ref>http-connector</connector-ref>
                    </broadcast-group>
                </broadcast-groups>
                <discovery-groups>
                    <discovery-group name="dg-group1">
                        <jgroups-stack>udp</jgroups-stack>
                        <jgroups-channel>hq-cluster</jgroups-channel>
                    </discovery-group>
                </discovery-groups>
                <cluster-connections>
                    <cluster-connection name="my-cluster">
                        <address>jms</address>
                        <connector-ref>http-connector</connector-ref>
                        <discovery-group-ref discovery-group-name="dg-group1"/>
                    </cluster-connection>
                </cluster-connections>
                ...
            </hornetq-server>
        </subsystem>
        ...

It's worth noting that WildFly 9 was release in July of 2015, almost 7 years ago now. The current version is 26.1.0.Final. I strongly encourage you to upgrade to a more recent version.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM