Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARTEMIS-1365 Advisory consumers listed in Console #1647

Merged
merged 1 commit into from Nov 20, 2017

Conversation

gaohoward
Copy link
Contributor

Openwire clients create consumers to advisory topics to receive
notifications. As a result there are internal queues created
on advisory topics. Those consumer shouldn't be exposed via
management APIs which are used by the Console

To fix that the broker doesn't register any queues from
advisory addresses.

@andytaylor
Copy link
Contributor

Howard, This just turns off advisories completely from a management pov, we should have a switch to turn them off or on as well

@andytaylor
Copy link
Contributor

Also you need to make sure that the JMX objects aren't created at all for both addresses and queues

@michaelandrepearce
Copy link
Contributor

michaelandrepearce commented Nov 7, 2017

As a user if a remote client attaches to advisory or management addresses we would like to still see those so if something goes rogue we know what is attached. As such i agree with Andy having this shown or not should be toggle-able.

Also another note, but it seems AddressInfo should have a boolean field 'isInternal' to denote if it is an internal address, that can be set by the OpenWire protocol on creation of the address rather than building protocol logic into the server modules outside the protocol layers. Im discussing this section:

"public class AddressInfo {

//from openwire
public static final SimpleString ADVISORY_TOPIC = new SimpleString("ActiveMQ.Advisory.");
"

that was recently added in #1587

Also a query not related to this PR, but from my understanding advisories are very much like management notifications, yet i don't see it tapping into that feed to make the advisories?

@@ -130,6 +130,10 @@ public String toString() {
}

public boolean isInternal() {
return this.name.startsWith(ADVISORY_TOPIC);
return isInternal(this.name);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be a boolean field internal, that is set by the protocol layer, we shouldn't have protocol specific bits in the core models.

return isInternal(this.name);
}

public static boolean isInternal(SimpleString address) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't be needed should be an attribute on the AddressInfo

@gaohoward
Copy link
Contributor Author

@andytaylor @michaelandrepearce guys agreed please don't merge, I'm making more changes now.
@michaelandrepearce I'm not sure about your query can you rephrase?
Advisories is openwire notification feature. We don't support the full feature, but we do have some implemented (as a by-product required for some other features in amq5 I don't remember exactly thou).

@michaelandrepearce
Copy link
Contributor

michaelandrepearce commented Nov 9, 2017

@gaohoward ill take the question part to dev mail probably should have done it in first place. And just concentrate on pr details here

@gaohoward
Copy link
Contributor Author

Guys, so I added a parameter to OpenwireProtocolManager, named supportAdvisory. If set to false, no advisory addresses/queues will be created. Default is true.
However I'm not sure about the Console. When supportAdvisory is true, I would still want to hide the JMX objects (not register them but stored them in a list) so that the Console user won't be bothered by them. I think there should be a way to let the user to view those objects, may be adding one operation to the management api? I'm not sure, what you guys think of it?

@andytaylor
Copy link
Contributor

andytaylor commented Nov 9, 2017 via email

@gaohoward
Copy link
Contributor Author

ok, make sense to me.

@michaelandrepearce
Copy link
Contributor

michaelandrepearce commented Nov 9, 2017

Still would like the logic to sit within openwire protocol to set an address to internal and not within core classes, addressinfo should just hold a Boolean flag of if it should be treated as internal address or not, this way if future cases the logic is held only in the specific protocol

@clebertsuconic
Copy link
Contributor

@andytaylor / @mtaylor this is an area of your expertise.. I will let you guys merge this one.

@gaohoward
Copy link
Contributor Author

@michaelandrepearce I'll find a way to remove the protocol specific from addressInfo.

@gaohoward
Copy link
Contributor Author

gaohoward commented Nov 13, 2017

I'll update this again. (Adding some doc about the newly added properties)
Pls hold the merge.

@gaohoward gaohoward force-pushed the amaster_1365 branch 2 times, most recently from bf5a323 to 6dc53af Compare November 14, 2017 04:44
@gaohoward
Copy link
Contributor Author

@mtaylor @michaelandrepearce guys I think it's ready for review now. Thanks!

@andytaylor
Copy link
Contributor

do we need to move the AddressInfo class?

@gaohoward
Copy link
Contributor Author

@andytaylor got a simple way to keep the AddressInfo. will upload soon after local test check.

@gaohoward
Copy link
Contributor Author

@andytaylor I've made changes to keep AddressInfo in its original package. can you take a look at it?
Thanks.

@andytaylor
Copy link
Contributor

looks ok to me

Copy link
Contributor

@michaelandrepearce michaelandrepearce left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t see any update in the code to persist the extra field so it’s kept in restart.

Like wise I don’t see any way of configuring this in broker xml. (this one could be done later as separate pr)

Also a few left over system outs

@@ -316,6 +316,7 @@ private void validateRoutingTypes(SimpleString addressName, Collection<RoutingTy
if (binding instanceof QueueBinding) {
final QueueBinding queueBinding = (QueueBinding) binding;
final RoutingType routingType = queueBinding.getQueue().getRoutingType();
System.out.println("got a queue binding........... " + queueBinding.getQueue().getName() + " rt: " + routingType);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be removed

@@ -1221,6 +1240,7 @@ public Response processWireFormat(WireFormatInfo command) throws Exception {
public Response processAddDestination(DestinationInfo dest) throws Exception {
Response resp = null;
try {
System.out.println("___adding dest: " + dest);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be removed

@andytaylor
Copy link
Contributor

@michaelandrepearce it is configured in the broker.xml file via the acceptor url so Im fine with that, dont think we need to persist it. Im happy to merge this.

@michaelandrepearce
Copy link
Contributor

@andytaylor can we remove the sysouts before merging.

@andytaylor
Copy link
Contributor

@michaelandrepearce yes, I will wait before merging

Openwire clients create consumers to advisory topics to receive
notifications. As a result there are internal queues created
on advisory topics. Those consumer shouldn't be exposed via
management APIs which are used by the Console

To fix that the broker doesn't register any queues from
advisory addresses.

Also refactors a code to remove Openwire specific contants
from AddressInfo class.
@gaohoward
Copy link
Contributor Author

Sorry about the System.out, I've remove them.
Thanks guys!

@michaelandrepearce
Copy link
Contributor

michaelandrepearce commented Nov 17, 2017

@gaohoward thanks for all the changes, appreciate the effort, great work. +1 from me.

@gaohoward
Copy link
Contributor Author

Thanks @michaelandrepearce, great help!

@asfgit asfgit merged commit 5fe88e1 into apache:master Nov 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
6 participants