jboss

package
v0.5.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 13, 2025 License: Apache-2.0 Imports: 21 Imported by: 0

README

JBoss/WildFly Source

This source monitors JBoss/WildFly deployments via the management API using HTTP digest authentication. It polls the management interface at configurable intervals to retrieve deployment status information.

Configuration

{
  "type": "jboss",
  "wildflyUrl": "http://localhost:9990/management",
  "username": "admin",
  "password": "your-password",
  "pollingInterval": "30s"
}
Configuration Options
  • wildflyUrl (optional): WildFly management URL. Default: http://localhost:9990/management
  • username (optional): Management username. Default: admin
  • password (required): Management password
  • pollingInterval (optional): Polling interval for checking deployments. Default: 30s

Features

  • Digest Authentication: Supports HTTP digest authentication with WildFly management interface
  • Deployment Monitoring: Monitors all deployments and their status
  • Configurable Polling: Adjustable polling interval for monitoring frequency
  • Event Generation: Creates pipeline events for deployment status changes

Events

The source generates events of type jboss:deployment_status with the following structure:

{
  "deployment": {
    "name": "my-app.war",
    "runtimeName": "my-app.war", 
    "status": "OK",
    "enabled": true,
    "persistentDeployed": true
  },
  "timestamp": "2025-01-01T12:00:00Z",
  "eventType": "jboss:deployment_status"
}

Requirements

  • JBoss/WildFly with management interface enabled
  • Management user with appropriate permissions
  • Network connectivity to the management interface

Documentation

Index

Constants

View Source
const (
	// Event types for JBoss/WildFly deployments
	DeploymentStatusEvent = "jboss:deployment_status"
)

Variables

This section is empty.

Functions

func CreateDeploymentEvent

func CreateDeploymentEvent(deployment Deployment, timestamp time.Time) (entities.PipelineEvent, error)

CreateDeploymentEvent creates a pipeline event from a deployment

func NewJBossSource

func NewJBossSource(
	ctx context.Context,
	log *logrus.Logger,
	cfg config.GenericConfig,
	pipeline pipeline.IPipelineGroup,
	oasRouter *swagger.Router[fiber.Handler, fiber.Router],
) (sources.CloseableSource, error)

Types

type Config

type Config struct {
	WildFlyURL      string              `json:"wildFlyUrl,omitempty"`
	Username        string              `json:"username,omitempty"`
	Password        config.SecretSource `json:"password"`
	PollingInterval Duration            `json:"pollingInterval,omitempty"`
}

func (*Config) Validate

func (c *Config) Validate() error

type Deployment

type Deployment struct {
	Name          string                 `json:"name"`
	RuntimeName   string                 `json:"runtimeName"`
	Status        string                 `json:"status"`
	Enabled       bool                   `json:"enabled"`
	Persistent    bool                   `json:"persistent"`
	Content       []DeploymentContent    `json:"content,omitempty"`
	Subdeployment interface{}            `json:"subdeployment,omitempty"`
	Subsystem     map[string]interface{} `json:"subsystem,omitempty"`
}

Deployment represents a JBoss/WildFly deployment with all available information

type DeploymentContent

type DeploymentContent struct {
	Hash map[string]string `json:"hash,omitempty"`
}

DeploymentContent represents the content hash information

type DeploymentEvent

type DeploymentEvent struct {
	Deployment Deployment `json:"deployment"`
	Timestamp  time.Time  `json:"timestamp"`
	EventType  string     `json:"eventType"`
}

DeploymentEvent represents a JBoss/WildFly deployment status event

type Duration

type Duration time.Duration

Duration is a custom type that can unmarshal from JSON strings

func (Duration) Duration

func (d Duration) Duration() time.Duration

func (*Duration) UnmarshalJSON

func (d *Duration) UnmarshalJSON(data []byte) error

type JBossClient

type JBossClient struct {
	// contains filtered or unexported fields
}

JBossClient handles HTTP digest authentication with JBoss/WildFly management interface

func NewJBossClient

func NewJBossClient(baseURL, username, password string) (*JBossClient, error)

NewJBossClient creates a new JBoss client with digest authentication

func (*JBossClient) Close

func (c *JBossClient) Close() error

Close closes the HTTP client (if needed)

func (*JBossClient) GetDeployments

func (c *JBossClient) GetDeployments(s *JBossSource) ([]Deployment, error)

GetDeployments retrieves all deployments from WildFly

type JBossEventBuilder

type JBossEventBuilder struct{}

JBossEventBuilder implements the EventBuilder interface for JBoss events

func NewJBossEventBuilder

func NewJBossEventBuilder() *JBossEventBuilder

NewJBossEventBuilder creates a new JBoss event builder

func (*JBossEventBuilder) GetPipelineEvent

func (b *JBossEventBuilder) GetPipelineEvent(ctx context.Context, data []byte) (entities.PipelineEvent, error)

GetPipelineEvent creates a pipeline event from raw data

type JBossSource

type JBossSource struct {
	// contains filtered or unexported fields
}

func (*JBossSource) Close

func (s *JBossSource) Close() error

type ServletInfo

type ServletInfo struct {
	MaxRequestTime   int    `json:"maxRequestTime"`
	MinRequestTime   int    `json:"minRequestTime"`
	RequestCount     int    `json:"requestCount"`
	ServletClass     string `json:"servletClass"`
	ServletName      string `json:"servletName"`
	TotalRequestTime int    `json:"totalRequestTime"`
}

ServletInfo represents servlet information

type UndertowSubsystem

type UndertowSubsystem struct {
	ActiveSessions  int                    `json:"activeSessions"`
	ContextRoot     string                 `json:"contextRoot"`
	Server          string                 `json:"server"`
	SessionsCreated int                    `json:"sessionsCreated"`
	VirtualHost     string                 `json:"virtualHost"`
	Servlet         map[string]ServletInfo `json:"servlet,omitempty"`
}

UndertowSubsystem represents Undertow web server subsystem information

type WildFlyPayload

type WildFlyPayload struct {
	Operation      string      `json:"operation"`
	Address        interface{} `json:"address"`
	Recursive      bool        `json:"recursive,omitempty"`
	IncludeRuntime bool        `json:"includeRuntime,omitempty"`
	JSONPretty     int         `json:"jsonPretty"`
}

WildFlyPayload represents the management API request payload

type WildFlyResponse

type WildFlyResponse struct {
	Outcome            string      `json:"outcome"`
	Result             interface{} `json:"result,omitempty"`
	FailureDescription string      `json:"failureDescription,omitempty"`
}

WildFlyResponse represents the management API response

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL