Skip to content

Commit

Permalink
Fix a kafkasql import bug
Browse files Browse the repository at this point in the history
  • Loading branch information
EricWittmann committed Mar 7, 2024
1 parent 82f6634 commit f2cb314
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -746,7 +746,8 @@ public void importGlobalRule(GlobalRuleEntity entity) {
*/
@Override
public void importContent(ContentEntity entity) {
var message = new ImportContent1Message(entity);
String content = ContentHandle.create(entity.contentBytes).content();
var message = new ImportContent1Message(entity, content);
var uuid = ConcurrentUtil.get(submitter.submitMessage(message));
coordinator.waitForResponse(uuid);
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package io.apicurio.registry.storage.impl.kafkasql.messages;

import io.apicurio.registry.content.ContentHandle;
import io.apicurio.registry.storage.RegistryStorage;
import io.apicurio.registry.storage.impl.kafkasql.AbstractMessage;
import io.apicurio.registry.utils.impexp.ContentEntity;
Expand All @@ -21,12 +22,14 @@
public class ImportContent1Message extends AbstractMessage {

private ContentEntity entity;
private String content;

/**
* @see io.apicurio.registry.storage.impl.kafkasql.KafkaSqlMessage#dispatchTo(io.apicurio.registry.storage.RegistryStorage)
*/
@Override
public Object dispatchTo(RegistryStorage storage) {
entity.contentBytes = ContentHandle.create(content).bytes();
storage.importContent(entity);
return null;
}
Expand Down

0 comments on commit f2cb314

Please sign in to comment.