question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

function apply protobuf input.

See original GitHub issue

Hello. I’m testing pulsar function for easy ETL job recently, but i encountered some errors that i couldn’t figure it out. there is my snippet. image

and producer is: image

Expected behavior

I assumed that localrunner could established a function process the deserialized messages with schema from schema registry, then produce to target topic.

Actual behavior

image

[ERROR] 2019-07-17 11:19:20.175 [public/default/Addressbook-0] JavaInstanceRunnable - [public/default/Addressbook:0] Uncaught exception in Java Instance
java.lang.UnsupportedOperationException: null
	at java.util.AbstractMap.put(AbstractMap.java:209) ~[?:1.8.0_201]
	at org.apache.pulsar.client.impl.schema.SchemaDefinitionBuilderImpl.build(SchemaDefinitionBuilderImpl.java:101) ~[pulsar-client-2.4.0.jar:2.4.0]
	at org.apache.pulsar.client.impl.schema.ProtobufSchema.ofGenericClass(ProtobufSchema.java:106) ~[pulsar-client-2.4.0.jar:2.4.0]
	at org.apache.pulsar.functions.source.TopicSchema.newSchemaInstance(TopicSchema.java:149) ~[pulsar-functions-local-runner-2.4.0.jar:2.4.0]
	at org.apache.pulsar.functions.source.TopicSchema.newSchemaInstance(TopicSchema.java:173) ~[pulsar-functions-local-runner-2.4.0.jar:2.4.0]
	at org.apache.pulsar.functions.source.TopicSchema.lambda$getSchema$0(TopicSchema.java:66) ~[pulsar-functions-local-runner-2.4.0.jar:2.4.0]
	at java.util.HashMap.computeIfAbsent(HashMap.java:1127) ~[?:1.8.0_201]

Could anyone telling what to do, cause I could not find any document or example showing how it work.

System configuration

Pulsar version: 2.4

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
jerrypengcommented, Jul 17, 2019

@YangZunYu I think there is a bug. Its a simple fix. It involves this line of code:

https://github.com/apache/pulsar/blob/master/pulsar-functions/instance/src/main/java/org/apache/pulsar/functions/source/TopicSchema.java#L149

Can’t use Collections.emptyMap() because it doesn’t allow anything to be added to it later.

0reactions
sijiecommented, Nov 25, 2019

This has been fixed in the latest master.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Overview | Protocol Buffers - Google Developers
The code generated by protocol buffers provides utility methods to retrieve data from files and streams, extract individual values from the ...
Read more >
How to use Protobuf for data interchange - Opensource.com
The IDL document, in both DCE/RPC and Protobuf, is the input to utilities that create the infrastructure code for exchanging data:
Read more >
Tutorial: Protocol Buffer Basics
Protocol buffers solve the problem of efficiently serializing and deserializing structured data in a language-agnostic manner, accessible to a vast array of ...
Read more >
How to setup your Android app to use Protobuf - ProAndroidDev
Next step is creating a Java module and applying the protobuf plugin to build.gradle file by adding this line on top:
Read more >
Serialiazing your data with Protobuf - Conan Blog
Protocol Buffers is an open source project under the BSD 3-Clause license, a popular one developed by Google, to provide a language-neutral, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found