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

Issues with listening on Events as a client node #11303

Open
m-yassine1 opened this issue Apr 4, 2024 · 1 comment
Open

Issues with listening on Events as a client node #11303

m-yassine1 opened this issue Apr 4, 2024 · 1 comment

Comments

@m-yassine1
Copy link

m-yassine1 commented Apr 4, 2024

Hello,

I am trying to listen on some events, but I keep on getting NoSerilization Exception, and if I implement Serializable, I get a ClassNotFoundException.

I added the following property inside the XML file:

<property name="includeEventTypes">
	<list>
		<util:constant static-field="org.apache.ignite.events.EventType.EVT_CACHE_OBJECT_EXPIRED"/>
		<util:constant static-field="org.apache.ignite.events.EventType.EVT_CLUSTER_ACTIVATED"/>
		<util:constant static-field="org.apache.ignite.events.EventType.EVT_CLUSTER_DEACTIVATED"/>
	</list>
</property>

In my Java class, I added the following method:

    node.events().remoteListen(addExpiredQuote(), null, EventType.EVT_CACHE_OBJECT_EXPIRED);

Every time, it reaches this point, it throws the exceptions above.

I am creating a client node, that creates a cache in the cluster, and wants to listen on this event.
I had the following: node.cluster().forClientNodes(GRID_GAIN_QUOTE_CACHE)

Unfortunately, it starts up and I have a break point inside the function that should be called, but it never goes there when the object is evicted.

This is the cache configuration:

<bean class="org.apache.ignite.configuration.CacheConfiguration">
	<property name="name" value="RFQ_REST_QUOTE_CACHE"/>
	<property name="cacheMode" value="REPLICATED"/>
	<property name="rebalanceMode" value="SYNC"/>
	<property name="partitionLossPolicy" value="READ_ONLY_SAFE"/>
	<property name="eagerTtl" value="true"/>
	<property name="expiryPolicyFactory">
		<bean class="javax.cache.expiry.CreatedExpiryPolicy" factory-method="factoryOf">
			<constructor-arg>
				<bean class="javax.cache.expiry.Duration">
					<constructor-arg value="SECONDS"/>
					<constructor-arg value="30"/>
				</bean>
			</constructor-arg>
		</bean>
	</property>
</bean>

Can you please help?

@sk0x50
Copy link
Contributor

sk0x50 commented Apr 18, 2024

Hi @m-yassine1,

Could you please share the implementation of your local listener and provide a full stack trace of the mentioned exceptions?
It would be great if you could upload your project to GitHub and provide a link.

By the way, node.cluster().forClientNodes(GRID_GAIN_QUOTE_CACHE) returns a cluster group for all client nodes that access the cache with the specified name. Client nodes do not store any data and so do not fire events like EVT_CACHE_OBJECT_EXPIRED.

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