Tabnine Logo
PublishRequest.newBuilder
Code IndexAdd Tabnine to your IDE (free)

How to use
newBuilder
method
in
com.google.pubsub.v1.PublishRequest

Best Java code snippets using com.google.pubsub.v1.PublishRequest.newBuilder (Showing top 9 results out of 315)

origin: googleapis/google-cloud-java

@java.lang.Override
public Builder newBuilderForType() {
 return newBuilder();
}
origin: googleapis/google-cloud-java

/**
 * Adds one or more messages to the topic. Returns `NOT_FOUND` if the topic does not exist.
 *
 * <p>Sample code:
 *
 * <pre><code>
 * try (TopicAdminClient topicAdminClient = TopicAdminClient.create()) {
 *   ProjectTopicName topic = ProjectTopicName.of("[PROJECT]", "[TOPIC]");
 *   ByteString data = ByteString.copyFromUtf8("");
 *   PubsubMessage messagesElement = PubsubMessage.newBuilder()
 *     .setData(data)
 *     .build();
 *   List&lt;PubsubMessage&gt; messages = Arrays.asList(messagesElement);
 *   PublishResponse response = topicAdminClient.publish(topic.toString(), messages);
 * }
 * </code></pre>
 *
 * @param topic The messages in the request will be published on this topic. Format is
 *     `projects/{project}/topics/{topic}`.
 * @param messages The messages to publish.
 * @throws com.google.api.gax.rpc.ApiException if the remote call fails
 */
/* package-private */ final PublishResponse publish(String topic, List<PubsubMessage> messages) {
 PublishRequest request =
   PublishRequest.newBuilder().setTopic(topic).addAllMessages(messages).build();
 return publish(request);
}
origin: googleapis/google-cloud-java

PublishRequest.newBuilder()
  .setTopic(topic == null ? null : topic.toString())
  .addAllMessages(messages)
origin: googleapis/google-cloud-java

private void publishOutstandingBatch(final OutstandingBatch outstandingBatch) {
 PublishRequest.Builder publishRequest = PublishRequest.newBuilder();
 publishRequest.setTopic(topicName);
 for (OutstandingPublish outstandingPublish : outstandingBatch.outstandingPublishes) {
origin: com.google.api.grpc/proto-google-cloud-pubsub-v1

@java.lang.Override
public Builder newBuilderForType() {
 return newBuilder();
}
origin: com.google.api.grpc/grpc-google-pubsub-v1

public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
origin: com.google.api.grpc/grpc-pubsub-v1

public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform

@Override
public int publish(TopicPath topic, List<OutgoingMessage> outgoingMessages) throws IOException {
 PublishRequest.Builder request = PublishRequest.newBuilder().setTopic(topic.getPath());
 for (OutgoingMessage outgoingMessage : outgoingMessages) {
  PubsubMessage.Builder message =
    PubsubMessage.newBuilder().setData(ByteString.copyFrom(outgoingMessage.elementBytes));
  if (outgoingMessage.attributes != null) {
   message.putAllAttributes(outgoingMessage.attributes);
  }
  if (timestampAttribute != null) {
   message
     .getMutableAttributes()
     .put(timestampAttribute, String.valueOf(outgoingMessage.timestampMsSinceEpoch));
  }
  if (idAttribute != null && !Strings.isNullOrEmpty(outgoingMessage.recordId)) {
   message.getMutableAttributes().put(idAttribute, outgoingMessage.recordId);
  }
  request.addMessages(message);
 }
 PublishResponse response = publisherStub().publish(request.build());
 return response.getMessageIdsCount();
}
origin: org.apache.beam/beam-sdks-java-io-google-cloud-platform

    .build();
final PublishRequest expectedRequest =
  PublishRequest.newBuilder()
    .setTopic(expectedTopic)
    .addAllMessages(ImmutableList.of(expectedPubsubMessage))
com.google.pubsub.v1PublishRequestnewBuilder

Popular methods of PublishRequest

  • getTopic
    The messages in the request will be published on this topic. optional string topic = 1;
  • getDefaultInstance
  • getMessagesCount
    The messages to publish. repeated .google.pubsub.v1.PubsubMessage messages = 2;
  • <init>
  • getMessagesList
    The messages to publish. repeated .google.pubsub.v1.PubsubMessage messages = 2;
  • getTopicBytes
    The messages in the request will be published on this topic. optional string topic = 1;
  • isInitialized
  • makeExtensionsImmutable
  • toBuilder
  • getDescriptor
  • getDescriptorForType
  • getSerializedSize
  • getDescriptorForType,
  • getSerializedSize,
  • parseUnknownFieldProto3

Popular in Java

  • Running tasks concurrently on multiple threads
  • findViewById (Activity)
  • getSystemService (Context)
  • compareTo (BigDecimal)
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • PriorityQueue (java.util)
    A PriorityQueue holds elements on a priority heap, which orders the elements according to their natu
  • SortedMap (java.util)
    A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
  • BoxLayout (javax.swing)
  • Table (org.hibernate.mapping)
    A relational table
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now