---
apiVersion: v1
kind: ConfigMap
metadata:
  labels:
    funktion.fabric8.io/kind: Connector
  name: browse
data:
  deployment.yml: |
    ---
    apiVersion: extensions/v1beta1
    kind: Deployment
    metadata:
      labels:
        funktion.fabric8.io/kind: Subscription
        connector: browse
    spec:
      replicas: 1
      template:
        metadata:
          labels:
            funktion.fabric8.io/kind: Subscription
            connector: browse
        spec:
          containers:
          - image: funktion/connector-browse:${project.version}
            name: connector
  schema.yml: |
    ---
    component:
      kind: component
      scheme: browse
      syntax: browse:name
      title: Browse
      description: The browse component is used for viewsing the messages received on endpoints that supports BrowsableEndpoint.
      label: core,monitoring
      deprecated: false
      async: false
      javaType: org.apache.camel.component.browse.BrowseComponent
      groupId: org.apache.camel
      artifactId: camel-core
      version: 2.18.3
    componentProperties: {}
    properties:
      name:
        kind: path
        group: common
        required: true
        type: string
        javaType: java.lang.String
        deprecated: false
        secret: false
        description: A name which can be any string to uniquely identify the endpoint
        order: 0
      bridgeErrorHandler:
        kind: parameter
        group: consumer
        label: consumer
        type: boolean
        javaType: boolean
        optionalPrefix: consumer.
        deprecated: false
        secret: false
        defaultValue: false
        description: Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
        order: 1
      exceptionHandler:
        kind: parameter
        group: consumer (advanced)
        label: consumer,advanced
        type: object
        javaType: org.apache.camel.spi.ExceptionHandler
        optionalPrefix: consumer.
        deprecated: false
        secret: false
        description: To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
        order: 2
      exchangePattern:
        kind: parameter
        group: consumer (advanced)
        label: consumer,advanced
        type: string
        javaType: org.apache.camel.ExchangePattern
        enum:
        - InOnly
        - RobustInOnly
        - InOut
        - InOptionalOut
        - OutOnly
        - RobustOutOnly
        - OutIn
        - OutOptionalIn
        deprecated: false
        secret: false
        description: Sets the default exchange pattern when creating an exchange.
        order: 3
      synchronous:
        kind: parameter
        group: advanced
        label: advanced
        type: boolean
        javaType: boolean
        deprecated: false
        secret: false
        defaultValue: false
        description: Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
        order: 4
  documentation.adoc: |+
    [[Browse-BrowseComponent]]
    Browse Component
    ~~~~~~~~~~~~~~~~

    The Browse component provides a simple
    link:browsableendpoint.html[BrowsableEndpoint] which can be useful for
    testing, visualisation tools or debugging. The exchanges sent to the
    endpoint are all available to be browsed.

    [[Browse-URIformat]]
    URI format
    ^^^^^^^^^^

    [source,java]
    -------------------------
    browse:someName[?options]
    -------------------------

    Where *someName* can be any string to uniquely identify the endpoint.


    [[Gora-Options]]
    Options
    ~~~~~~~


    // component options: START
    The Browse component has no options.
    // component options: END



    // endpoint options: START
    The Browse component supports 5 endpoint options which are listed below:

    {% raw %}
    [width="100%",cols="2,1,1m,1m,5",options="header"]
    |=======================================================================
    | Name | Group | Default | Java Type | Description
    | name | common |  | String | *Required* A name which can be any string to uniquely identify the endpoint
    | bridgeErrorHandler | consumer | false | boolean | Allows for bridging the consumer to the Camel routing Error Handler which mean any exceptions occurred while the consumer is trying to pickup incoming messages or the likes will now be processed as a message and handled by the routing Error Handler. By default the consumer will use the org.apache.camel.spi.ExceptionHandler to deal with exceptions that will be logged at WARN/ERROR level and ignored.
    | exceptionHandler | consumer (advanced) |  | ExceptionHandler | To let the consumer use a custom ExceptionHandler. Notice if the option bridgeErrorHandler is enabled then this options is not in use. By default the consumer will deal with exceptions that will be logged at WARN/ERROR level and ignored.
    | exchangePattern | consumer (advanced) |  | ExchangePattern | Sets the default exchange pattern when creating an exchange.
    | synchronous | advanced | false | boolean | Sets whether synchronous processing should be strictly used or Camel is allowed to use asynchronous processing (if supported).
    |=======================================================================
    {% endraw %}
    // endpoint options: END


    [[Browse-Sample]]
    Sample
    ^^^^^^

    In the route below, we insert a `browse:` component to be able to browse
    the Exchanges that are passing through:

    [source,java]
    -------------------------------------------------------------------------------
      from("activemq:order.in").to("browse:orderReceived").to("bean:processOrder");
    -------------------------------------------------------------------------------

    We can now inspect the received exchanges from within the Java code:

    [source,java]
    --------------------------------------------------------------------------------------------------------
        private CamelContext context;

        public void inspectRecievedOrders() {
            BrowsableEndpoint browse = context.getEndpoint("browse:orderReceived", BrowsableEndpoint.class);
            List<Exchange> exchanges = browse.getExchanges();
            ...
            // then we can inspect the list of received exchanges from Java
            for (Exchange exchange : exchanges) {
                String payload = exchange.getIn().getBody();
                ...
            }
       }
    --------------------------------------------------------------------------------------------------------

    [[Browse-SeeAlso]]
    See Also
    ^^^^^^^^

    * link:configuring-camel.html[Configuring Camel]
    * link:component.html[Component]
    * link:endpoint.html[Endpoint]
    * link:getting-started.html[Getting Started]

