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

how to get commands from Kapua to a client #7

Open
aycanvargun opened this issue Nov 15, 2018 · 4 comments
Open

how to get commands from Kapua to a client #7

aycanvargun opened this issue Nov 15, 2018 · 4 comments

Comments

@aycanvargun
Copy link

Hi again,

I can send data to my Kapua from the FuseClient now.

(1) But I want to get commands from Kapua to my Fuse Client (named soap8). I don't know how.
(2) In Kapua, I created a job (named job1). I added a step (named step1)
(3) Inside, i added a command as 'echo "123"'.
I want to get this command to my Fuse Client (named soap8) from my Kapua.

picture

I subscribed to "my receiver" topic in Java code. But, Is there any special topic for commands? In the java code, i don't now how to get the command from Kapua. Could you please help me?
In addition, In the constructor of FuseClient.java,

this.connection = connection;
connection.listener(this.listener);
connection.connect(new Promise<>());

Do i need this.listener in this.connection ? Do i have to change the code?

Thank you.

@ctron
Copy link
Owner

ctron commented Nov 15, 2018

@aycanvargun
Copy link
Author

I subscribed to a topic ("receiver") and wait for the connection, I get error from broker container logs,

07:33:09.392 [ActiveMQ NIO Worker 4] WARN o.a.a.t.m.s.AbstractMQTTSubscriptionStrategy - Error subscribing to acme123/soap9/app1/my/receiver
java.lang.SecurityException: User user123 (soap9 - tcp://217.78.106.69:56486 - conn id 600724459434597600) is not authorized to read from: Consumer.8,539,744,234,403,289,497:soap9:AT_LEAST_ONCE.VirtualTopic.acme123.soap9.app1.my.receiver

I subscribed to the topic ("sender") that I created, I get error from broker container logs,

[Camel (camelContext) thread #17 - JmsConsumer[Consumer.eurotech:mainRoutelisteners:EXACTLY_ONCE.VirtualTopic.%3E]] WARN eclipselink.logging.all - Exception [EclipseLink-5006] (Eclipse Persistence Services - 2.6.3.v20160428-59c81c5): org.eclipse.persistence.exceptions.OptimisticLockException
Exception Description: The object [org.eclipse.kapua.service.device.registry.internal.DeviceImpl@7e72d798[tagIds={[]},groupId=,clientId=soap9,connectionId=600724459434597600,connection=org.eclipse.kapua.service.device.registry.connection.internal.DeviceConnectionImpl@a1061e2,status=ENABLED,displayName=,lastEventId=4757100873288453679,lastEvent=org.eclipse.kapua.service.device.registry.event.internal.DeviceEventImpl@4db71c89,serialNumber=,modelId=,imei=,imsi=,iccid=,biosVersion=,firmwareVersion=,osVersion=10.0,jvmVersion=1.8.0_181,osgiFrameworkVersion=,applicationFrameworkVersion=,connectionInterface=,connectionIp=,applicationIdentifiers=,acceptEncoding=,customAttribute1=,customAttribute2=,customAttribute3=,customAttribute4=,customAttribute5=,modifiedOn=Tue Nov 20 07:28:05 UTC 2018,modifiedBy=917791760301272189,optlock=5,attributes=,properties=,id=2278622550366941087,scopeId=8539744234403289497,createdOn=Tue Nov 20 07:22:01 UTC 2018,createdBy=917791760301272189]] cannot be updated because it has changed or been deleted since it was last read.
Class> org.eclipse.kapua.service.device.registry.internal.DeviceImpl Primary Key> 2,278,622,550,366,941,087
07:28:05.081 [Camel (camelContext) thread #17 - JmsConsumer[Consumer.eurotech:mainRoutelisteners:EXACTLY_ONCE.VirtualTopic.%3E]] ERROR o.e.k.b.c.l.DeviceMessageListener - Error while processing device birth life-cycle event
org.eclipse.kapua.KapuaOptimisticLockingException: The entity is out of state as it has been modified or deleted by another transaction.

@ctron
Copy link
Owner

ctron commented Nov 20, 2018

Both problems look like an issue in Kapua, and less like an issue in the gateway client to me.

Maybe you can ask a question about that on the kapua-dev mailing list, or on the eclipse/kapua project on GitHub.

@aycanvargun
Copy link
Author

Ok, I will as. Thank you.

Kind Regards.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants