This message was deleted.
# general
s
This message was deleted.
c
Hi @Ali Ustek can you create an issue in Github w/ some details about what you are seeing?
Looking above and I noticed an unrelated issue that must have snuck in the original PR https://github.com/apache/pulsar-client-reactive/issues/127. I will fix this soon. But it should not affect what you are seeing one way or the other @Ali Ustek
cc: @Christophe Bornet
@Ali Ustek I missed the
spring-pulsar/reactive
prefix of your question. Can you create the issue in the Spring Pulsar Github repo as I was thinking you were seeing issues in the Pulsar reactive client.
a
The issue I'm having is when a class contains an
Instant
attribute, the error is
org.apache.pulsar.client.api.SchemaSerializationException: <http://org.apache.pulsar.shade.com|org.apache.pulsar.shade.com>.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type 'java.time.Instant' not supported by default: add Module "org.apache.pulsar.shade.com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling
I certainly can create an issue, just tell me where to create it
c
Interesting. Thx for reporting this. The link is in my previous msg. If you could provide a simple sample to repro it, that would be super helpful. We will get it figured out..
j
The error is most probably just that there is no jackson time module in the classpath.
c
@JooHyukKim that module is required but I think this has to do w/ the fact that Jackson is being shaded in the Pulsar client (hence looking for
org.apache.pulsar.shade.com.fasterxml.jackson.datatype:jackson-datatype-jsr310
. I think this may be an issue w/ the Pulsar client shading. What version of Spring Pulsar and Pulsar client are you using @Ali Ustek?
It looks like this has been a pain the in the client for a while. Please take a look through: • https://github.com/apache/pulsar/pull/19458 • https://github.com/apache/pulsar/issues/19243 • https://github.com/apache/pulsar/pull/19161 I think this should be fixed in Pulsar client
2.12
and
3.0.x
(according to the last PR in the list above.
c
@Ali Ustek the reason it works w/
0.2.1-SNAPSHOT
is because that version is using Pulsar client 3.0.0 (which has the fix in the Pulsar client (see links above). I will take a look sometime today though and see what I can see on my end. In these cases, the 1st thing I do is remove Spring Pulsar from the equation and use the client directly and see if the issue is still there. That helps pinpoint where the issue lies. I will comment on the ticket once I take a look.
a
Well, it doesn't exactly work, there is no exception but no messages are actually published to topic either
c
Yeh I got that, I just meant that the jackson error is gone. Why it is not published may be unrelated. If it is simple for you to remove Spring Pulsar and try this directly w/ vanilla Pulsar client that would point us to where the issue lies. This is what I will do when I get some time today. Thanks again @Ali Ustek
a
Tried with
Copy code
public class SensorPublisher {
    public static void main(String[] args) throws PulsarClientException {
        PulsarClient pulsarClient =
                PulsarClient.builder().serviceUrl("<pulsar://localhost:6650>").build();
        ReactivePulsarClient reactivePulsarClient = AdaptedReactivePulsarClientFactory.create(pulsarClient);
        ReactiveMessageSender<SensorEvent> messageSender = reactivePulsarClient
                .messageSender(Schema.JSON(SensorEvent.class))
                .topic(SENSOR_INGEST_TOPIC_NAME)
                .build();
        Mono<MessageId> messageId = messageSender.sendOne(MessageSpec.of(new SensorEvent("sample", 25, Instant.now())));
messageId.subscribe(System.out::println);
    }
}
Still getting the exception
Copy code
15:44:25.559 [pulsar-client-io-1-1] ERROR reactor.core.publisher.Operators - Operator called default onErrorDropped
reactor.core.Exceptions$ErrorCallbackNotImplemented: org.apache.pulsar.client.api.SchemaSerializationException: org.apache.pulsar.shade.com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type `java.time.Instant` not supported by default: add Module "org.apache.pulsar.shade.com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: com.collibra.events.model.SensorEvent["time"])
Caused by: org.apache.pulsar.client.api.SchemaSerializationException: org.apache.pulsar.shade.com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Java 8 date/time type `java.time.Instant` not supported by default: add Module "org.apache.pulsar.shade.com.fasterxml.jackson.datatype:jackson-datatype-jsr310" to enable handling (through reference chain: com.collibra.events.model.SensorEvent["time"])
c
And if you don’t use the ReactivePulsarClient at all and instead just the regular PulsarClient?
a
the same
c
What version of Pulsar client are you using?
a
3..0.0
same project, as the one I posted
I can post the gradle scan if you like
c
Sure.
a
that's the last PR
c
Yeh.
It does sound like it is a Pulsar core client issue though. I have a couple of other priorities today but will pull down your sample and see what I see - just have not had a chance yet.
a
c
Another thing to try, start w/ a fresh java project, don’t include anything spring-pulsar at all (not even on the classpath) …. same issue?
It looks like you are using Spring Boot 3.1.1 (from scan). Note that Spring Pulsar
0.2.x
is compatible w/ SB
3.0x
and maybe compatible w/ SB
3.1.x
(see https://docs.spring.io/spring-pulsar/docs/current-SNAPSHOT/reference/html/#appendix.version-compatibility). I don’t think this is the issue though - just pointing this out.
a
with plain pulsar-client message was published
👍 1
c
Ok, it took me longer to get around to this - but I did. See here for an explanation and workaround. https://github.com/spring-projects/spring-pulsar/issues/427#issuecomment-1656549741
a
Thx a lot Chris
c
Nws. Ty @Ali Ustek